Document that a promise can be invoked to deliver

Description

Promises can be invoked to deliver a value to them (same result as calling deliver), but this is not mentioned in the docstring:

Docstring before:

Proposed: Change docstring to:

Patch: clj-2480-2.patch
Prescreened by: Alex Miller

Environment

None

Activity

Show:
Howard Lewis Ship
February 12, 2019, 7:06 AM

I think we disagree about the value (or definition) of excessive concision in docstrings.

import
March 3, 2019, 11:24 PM

Comment made by: pbwolf

Calling a promise does not always return the promise. Also, the docstring on deliver does not describe the return value. I hope the two docstrings (promise and deliver) will be kept in synch.

Opinion: it looks to me in the clojure source code like the IFn might just have been a reify hack to let deliver touch the promise. If calling the promise directly had been the plan for the official API, deliver would not exist. Do we really need two ways to deliver? If folks start eschewing deliver, I'll lose a great word to grep clj files for!

Assignee

Unassigned

Reporter

Howard Lewis Ship

Labels

Approval

Prescreened

Patch

Code

Affects versions

Priority

Major