It is quite easy to write a macro define in clojure that does that:
(defmacro define [head & body]
(if (sequential? head)
`(define ~(first head) (fn [ ~@(rest head)] ~@body))
`(def ~head ~@body)))
(define ((A [p1 p2]) [p3 p4]) [p2 p4]))
((A [1 2]) [3 4]) => [2 4]
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
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