On Jan 9, 12:50 am, "Mark Engelberg" <mark.engelb...@gmail.com> wrote:
> Oh, I mentioned this in my blog post, but perhaps it bears repating.
> If cycle, repeat, and replicate were implemented behind-the-scenes
> with LazySeq as opposed to LazyCons, they would still implement the
> promise of identical elements for separate traversals, but would be
> more efficient. Also, range always returns a sequence of numbers
> which are inherently identical when equal, so that would be another
> one that makes sense as a LazySeq. There are probably a few more that
> could also guarantee identity and would benefit from a LazySeq
> implementation (take, takewhile, and butlast come to mind). Is there
> any downside to making at least those changes?
When I had lazy-seq in play, many of those were defined that way. The
real cost is explaining either why lazy-seq is private, or, if public,
when/how to use it.
Rich
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---