> user=> (flatten nil)
> (nil)

Not a bug.

flatten returns a sequence  - in this case a sequence containing 'nil.
How else would you flatten on nil?

In the former cases the flatten returns the seq - nil
Can Clojure return an empty sequence otherwise?

(def x ())
(first x)
=> nil
(def y x)
y
=> nil

user> (def y x)
#'user/y
user> y
nil
user> (flatten y)
(nil)


On Dec 14, 9:16 pm, Michel Salim <michel.syl...@gmail.com> wrote:
> On Dec 14, 3:16 pm, Randall R Schulz <rsch...@sonic.net> wrote:
>
> > Does this makes sense (specifically the last one)?
>
> > user=> (flatten [])
> > nil
>
> > user=> (flatten ())
> > nil
>
> Yes; the empty sequence is just nil.
>
> > user=> (flatten nil)
> > (nil)
>
> That does look like a bug.
>
> --
> Michel
--~--~---------~--~----~------------~-------~--~----~
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