On Thu, Mar 11, 2010 at 2:19 PM, Brian Hurt <bhur...@gmail.com> wrote:
> So the doc comment on empty? reads, in part:
>
>> Please use the idiom (seq x) rather than (not (empty? x))
>
> A heads up to people: these two code sequences are *not* identical in
> behavior:
>
> user=> (seq? '())
> true
> user=> (not (empty? '()))
> false
What you demonstrated is that (seq x) is not the same as
(seq? x) -- useful to know, but not the point of the docstring.

Also note that it's not necessary or idiomatic to quote the empty
list:

user=> (seq ())
nil

--Chouser
http://joyofclojure.com/

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