On Wednesday 24 December 2008 13:44, Mark Volkmann wrote:
> Why doesn't the list below that is the second argument to reduce need
> to be quoted?
> Is () always treated the same as '() ?
>
> (reduce conj () (range 5))

Empty lists self-evaluate:

user=> ()
()

user=> '()
()


Similarly:

user=> (eval ())
()

user=> (eval '())
()

user=> (eval '(()))
java.lang.ClassCastException: clojure.lang.PersistentList$EmptyList cannot be 
cast to clojure.lang.IFn (repl-1:7)


Randall Schulz

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to