Or maybe more general question: Is there any function in Clojure which when returning empty sequence, returns nil instead of () ???
user=> (butlast [1 2 3]) (1 2) user=> (butlast [1]) nil user=> (butlast []) nil Thanks, Frantisek On Feb 18, 5:46 pm, 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) > > 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? > > Thank you, Frantisek > > On Feb 17, 8:43 pm, Rich Hickey <richhic...@gmail.com> wrote: > > > I've merged the lazy branch into trunk, SVN rev 1287 > > > Please do not rush to this version unless you are a library/tool > > developer. Let them do their ports and chime in on their progress. > > Move only when the libs/tools you depend upon have been ported. > > > Thanks to all for your feedback and input! > > > 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 -~----------~----~----~----~------~----~------~--~---