On Jan 21, 2009, at 8:58 PM, Vincent Foley wrote:

>
> I made some tests, and if I am not mistaken, if an eos is not
> specifically specified, Object is used, is that right?
>
> user=>
> (let [iter (stream-iter (range 5))]
>  (def s (stream (fn [eos]
>                   (let [x (next! iter eos)]
>                     (if (= eos x)
>                       (do (println eos) eos)
>                       x))))))
> #'user/s
> user=> (seq s)
> (0 1 2 3 #<Object java.lang.obj...@25c828>
> 4)

You should never rely on nor care about the value of eos, just return  
it if you are done.

It is always specified by some code, after all, it is a required arg  
of the generator. It happens that in this case the consumer code is in  
AStream.Seq, and is an Object.

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
-~----------~----~----~----~------~----~------~--~---

Reply via email to