Comment 7 for bug 260143

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote : Re: [Bug 260143] Re: free-identifier=? bug or by design?

On Aug 22, 2008, at 9:15 AM, leppie wrote:

> [(select s into k rest ...) ; select removed 'free-identifier=?'
> matchers
> (eq? (syntax->datum #'select) 'select)
> clauses ...

You can

(define (literal-identifier=? x y)
   (eq? (syntax->datum x) (syntax->datum y)))

and say:
   [(kwd s into k rest ...)
    (literal-identifier=? #'kwd #'select)
    ---]

What binding the keywords give you is the ability to rename and
prefix the auxiliary keywords when they're imported somewhere
else. Using literal-identifier=? hardwires the names.

Binding the auxiliary keywords (instead of leaving them unbound)
has the advantage that the user program would get an expand-time
error if they attempt to redefine the keywords (if they happen
to use libraries and scripts of course; you cannot help it at
the top-level). So, if you leave the auxiliary keywords unbound,
it's better to use literal-identifier=?. A third option is to
use an unbound identifier keyword and raise an exception if you
find it bound in the input of the macro (this is a little extreme
though).