Hi,

Am 19.12.2008 um 21:25 schrieb John D. Hume:
(ns foo)
(defmacro defthing [s]
 (let [thing-name 'thing]
   `(def ~thing-name (format "the %s thing" ~s))))

Simply put 'thing directly into the syntax-quote:

(defmacro defthing
  [s]
  `(def ~'thing (format "the %s thing" ~s)))

But be sure to clearly document, that you capture
symbols of a certain form with your macro. Otherwise
this may lead to clashes with user code! In your
example this is probably the point of the macro
to define a certain name. But in general capturing
names in macros is a bad thing.

Sincerely
Meikel

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to