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:
import
March 3, 2019, 12: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!

Howard Lewis Ship
February 11, 2019, 8:06 PM

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

Your pinned fields
Click on the next to a field label to start pinning.

Assignee

Unassigned

Reporter

Howard Lewis Ship

Labels

Approval

Prescreened

Patch

Code

Priority

Major

Affects versions