(defmacro $ [f & args]
(let [args2 (gensym)]
`(fn [& ~args2]
(eval (cons (quote ~f) (concat (quote ~args) ~args2))))))
Example:
(def add5 ($ + 5))
(add5 3)
Beware! For this macro evaluates the later parameters before the
partially-applied ones, so side-effectful parameters may occur in an
unexpected order.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---