2015-05-07 16:12 GMT+02:00 Stig Brautaset <sbrauta...@gmail.com>: > Is it because the def form can also be ^:dynamic? > Hm, cognitect turned it down, because basically "if you go down this road, why stop with def- ? and before you know, you've got a core namespace full of def*-"
> At any rate, I did an attempt at my first macro to create a (def- ...) > form, but it doesn't seem to work. Can you not attach metadata in a macro? > You can, but it works differently than in normal source. Remember, that ^ attaches metadata the literal, that you annotate. so ^:private ~sym is the symbol ~sym with a private metadata key. The quasiquoting, however, rebuilds the form and inserts the sym parameter in place of the ~sym form. So to attach the metadata to actual def'ed symbol, you need to attach it to the output, the macro generates, like this: `(def ~(with-meta sym {:private true}) ...) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.