l3nz / cli-matic

Compact, hands-free [sub]command line parsing library for Clojure.
Eclipse Public License 2.0
360 stars 28 forks source link

Check for IDeref, not IPending in isJvmPromise? #162

Closed NoahTheDuke closed 11 months ago

NoahTheDuke commented 11 months ago

IPending is not the way to check if a value can be dereferenced. It is an interface for the function isRealized, which is used to check if a given potentially-lazy sequence has been "realized" aka exhausted and fully consumed.

The desired interface is IDeref, which is checked in clojure.core/deref and which all of the deref'able data structures (atom, delay, etc) implement. (Futures can be deref'd because of the additional check in clojure.core/deref.)

Closes #161.