On Wednesday, April 16, 2014 10:35:14 PM UTC-5, Mars0i wrote:
>
>
> But then should realized? be able to deal with a Cons containing a LazySeq?
>
> (Is this an issue worthy of JIRA? I've never submitted there, and am not
> sure I know enough to do so. Willing to try to figure it out.)
>
No, realized? works as intended on a single object. If you want to know if
there is an unrealized portion remaining of a sequence, just roll your own
function to step through it, being careful not to force realization of
unrealized portions while doing so. Untested example:
(defn seq-realized?
"Returns false if there is an unrealized tail in the sequence,
otherwise true."
[s]
(if (instance? clojure.lang.IPending s)
(if (realized? s)
(if (seq s)
(recur (rest s))
true)
false)
(if (seq s)
(recur (rest s))
true)))
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.