Since I've criticized Arc for not having hygienic macros I thought it incumbent on me to offer a solution within the spirit of the language. Here's what I've come up with. 1. Arrange for DEF to define not only the identifier specified, but also an additional identifer with a distinguished prefix character (I suggest using the carat (^) to evoke the notion of "top level") and associates both of those identifiers with the same binding. 2. Within macros, adopt the convention that whenever you want to invoke a top-level definition you invoke the carat-prefix version. 3. Never locally bind any identifier that begins with a carat. So, for example: (def my-frob (x) ...) (mac my-macro (...) `(^my-frob ...)) Without the carat there is the danger that someone will do: (let my-frob ... (my-macro ...)) which won't work. With the carat convention that won't happen unless someone deliberately circumvents it by binding an identifier with a carat prefix. |