Using #() for "one off" functions, you get some odd behavior:
(reduce #(3) (range 1 100))
throws an exception:
java.lang.IllegalArgumentException: Wrong number of args passed to:
eval--2365$fn
as does:
(reduce (fn [] 3) (range 1 100)
but:
(reduce (constantly 3) (range 1 100))
performs as one would expect.

There are other trivial odd cases:
(#(3))
produces an exception.  But:
((fn [] 3))
does not.

Finally,
(#(%))
or even:
(#(%1))
throws an exception, but:
((fn [a] a))
does not.

I'll admit I haven't look at the source for the #() macro, but is this
type of behavior intended?  I don't fully grok macros in lisp, so I
may be missing something...

Thanks,
Rick
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to