Re: Macro metas (not meta macros)

2011-03-05 Thread Stuart Sierra
Just because it's metadata doesn't mean it won't get evaluated. Consider the following: (set! *print-meta* true) (defmacro defmeta [name meta value] `(def ~(with-meta name meta) ~value)) (macroexpand '(defmeta foo {:key a} 42)) ;;=> (def ^{:key a} foo 42) (defmeta f

Macro metas (not meta macros)

2011-03-05 Thread Alan
Something is going on that I don't understand, in the interplay between metadata, def'ing vars, and macros. I find myself writing a lot of (defn myfn "doc" [x y z] (foo (bar (baz x y z, so I figured I'd write a defcomp macro that I could call like (defcomp myfn "doc" [x y z] foo bar baz), to ma