Hello,
I was missing the prog1 macro from common lisp, so here it is.
(defmacro prog1 [& body]
" (prog1 forms*)
Evaluates all the forms, returning the result of the first form"
`(let [result# ~(first body)]
~@(rest body)
result#))
user> (prog1 "a" "b" "c")
"a"
user> (prog1)
nil
user> (prog1 "a")
"a"
Might be usefull to have this in the language. Maybe it's already there
but couldn't find it !
Sacha
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---