Just syntactical convenience I believe:
#((+ 1 %1)) looks silly :)
#(+ 1 %1) is nicer but more restrictive.

Notably you can still do multiple things:
user=> (#(let [] (println "hi") (+ 1 %1)) 1)
hi
2


On Feb 11, 3:09 pm, Mark Volkmann <r.mark.volkm...@gmail.com> wrote:
> Just checking my understanding of the rules for writing anonymous functions 
> ...
> (fn [args] ...) allows any number of expressions in its body.
> #(...) only allows a single expression in its body, correct?
> Why the difference?
>
> --
> R. Mark Volkmann
> Object Computing, Inc.
--~--~---------~--~----~------------~-------~--~----~
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