Christophe Grand a écrit : > I relaxed the constraint saying that "a stream ensures that every call > to seq on a stream will return the same seq" to be "a stream ensures > that every call to seq on a stream will return the same seq as long as > the stream state doesn't change". Well currently it's stronger than that: If you call seq on a stream, consume one item, call seq again then the second seq is the rest of the first one. This property being transitive you get:
ser=> (def s1 (stream (range 10))) #'user/s1 user=> (take1 s1)(take1 s1)(take1 s1) 0 1 2 user=> (def seq1 (seq s1)) #'user/seq1 user=> seq1 (3 4 5 6 7 8 9) user=> (take1 s1)(take1 s1)(take1 s1) 3 4 5 user=> (identical? (seq s1) (drop 3 seq1)) true --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---