Scheme has historically been used as a research vehicle for macros. When the fifth revised specification of Scheme (known as R5RS) was written there were no consensus on the best practices for writing a system supporting unhygienic macros.<p>Since then both R6RS and R7RS has support for unhygienic macros.<p>Note that there are two important properties of the macro systems of modern Scheme implementations: hygiene and referential transparency. The second property is often overlooked.<p>The standard syntax-rules macro system of R5RS Scheme is <i>hygienic</i><p><pre><code>    If a macro transformer inserts a binding for an identifier (variable or keyword), 
    the identifier will in effect be renamed throughout
    its scope to avoid conflicts with other identifiers.
</code></pre>
and <i>referentially transparent</i><p><pre><code>    If a macro transformer inserts a free reference to 
    an identifier, the reference refers to the binding 
    that was visible where the transformer was specified,
    regardless of any local bindings that may surround
    the use of the macro.
</code></pre>
The first property (automatically renaming of identifiers) is 
prevents common errors. This property is <i>easy</i> to hack around in macro systems without automatic renaming. The macro writer simply generates a new identifier (gensym) each time a new identifier is needed.<p>The second one <i>referential transparency</i> is the killer feature. Names inserted by a macro refers to binding where the macro is defined. This means that the macro writer has control over the meaning of the binding of identifiers in the expansion. In other words: a user of a macro can not by accident rebind or assign values to identifiers inserted by a macro use.<p>When referential transparency is not supported, then one must be careful to load libraries in the right order:<p><a href="http:&#x2F;&#x2F;fare.livejournal.com&#x2F;146698.html" rel="nofollow">http:&#x2F;&#x2F;fare.livejournal.com&#x2F;146698.html</a>