On Wed, Feb 18, 2009 at 11:46 AM, Frantisek Sodomka <fsodo...@gmail.com> wrote:
>
> What about 'conj'? Documentation says:
> (conj nil item) returns (item).
>
> Currently:
> user=> (conj nil 1)
> (1)
> user=> (conj () 1)
> (1)

Is there something wrong with that?  It looks right and like it
matches the docs to me.

> Idiom "conj nil" is used in 'reverse': (reduce conj nil coll)
> Currently:
> user=> (reverse [1 2])
> (2 1)
> user=> (reverse [1])
> (1)
> user=> (reverse [])
> nil
>
> It looks that now all sequence functions return () instead of nil. Is
> 'reverse' correct?

Things that return lazy seqs now return an empty lazy seq, which
prints as (), instead of nil.  However, 'reverse' is not lazy and
normally returns a PersistentList.  I don't know that it'd be more
correct to return an empty PersistentList than to return nil as it
does now.

--Chouser

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