Created
August 11, 2011 02:43
-
-
Save timmc/1138805 to your computer and use it in GitHub Desktop.
Playing around with name composition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro kf [& args] | |
(let [is-key #(= \_ (last (str %))) | |
ks (filter is-key args) | |
as (filter (complement is-key) args)] | |
(let [n (symbol (apply str (map name ks)))] | |
`(~n ~@as)))) | |
(defn do_not_ [a b] a) | |
(kf do_ 2 not_ (+ 3 4)) ;; (do_not_ 2 (+ 3 4)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment