Hey,

I guess because a sequence is not a datastructure.
If there is nothing to iterate over via 'first or 'next, then it's nil.

And an "empty sequence" is precisely that: nil.

In my point of view, a sequence is more like a "functional iterator":
calling first on it will always return the same value, calling next on
it will return either nil if we are at the end, either a new seq ...

Hope I'm clear and also correct,

-- 
Laurent


2010/1/15 Sean Devlin <francoisdev...@gmail.com>:
> Hey everyone,
> I was working with seq today, and I was wondering why I got a certain
> result.
>
> user=> (seq [])
> nil
>
> Why is nil returned, instead of an empty sequence?
>
> Sean
>
> --
> 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
> Note that posts from new members are moderated - please be patient with your 
> first post.
> 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
>
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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