>>
>> -- 2) Anonymous function:
>> Prelude> let f2 = \x -> x * 2
>> Prelude> f2 2
>> 4
>
> (def f2 (fn [x] (* x 2))) ; => #'user/f2
> (f2 2)                    ; => 4

Or even

(def f2 #(* % 2))

Stuart

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