fn has an implicit (do ...) #(do ...) behaves the same way. #(a b c) expands to (fn [] (a b c)) if you put in multiple forms you get #((a b)(c d)) expands to (fn [] ((a b) (c d))) note the (a b) in the operator position.
On Tue, Feb 10, 2009 at 8:09 PM, Mark Volkmann <[email protected]> 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. > > > > -- And what is good, Phaedrus, And what is not good— Need we ask anyone to tell us these things? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
