On Jan 21, 8:05 pm, e <evier...@gmail.com> wrote:
> I'm stopping to write this after the seq definition (bullet) to give you my
> exact feeling moving on. You may find that that is ok and that I will get
> it by the end of the page:
>
> What I assume at this point to be true is that if I first use an iter to *
> consume* some of the stream, that part is used up forever. If I make a new
> iter, I start consuming from that point. AND if I make a seq at this point,
> *first* will be the next piece of data that I would have seen in the iter.
> That last statement isn't explicitely made, but I assume it to be true.
Yes, that's it.
>
> The other thought I have at this point is, "I wonder if it's a technical
> reason I can't detach a seq, too . . . .and then when I do iter, I start
> consuming again." I'm guessing that any seq reference hanging around would
> then have to make a copy of the whole stream unlazilly, which would be
> dangerous because the unsuspecting user wouldn't know they were suffering a
> major performance hit.
>
Well, it's the combination of a seq being persistent and a stream
being one-pass - to realize the seq you'll need that pass. Also, seqs
are an acceptable escaping value from the stream mechanism.
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
-~----------~----~----~----~------~----~------~--~---