[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Namespaces

This page is part of the web mail archives of SRFI 72 from before July 7th, 2015. The new archives for SRFI 72 contain all messages, not just those from before July 7th, 2015.



Andre van Tonder <andre@xxxxxxxxxxxxxxxxx> writes:

>    (let ((x 1))
>      (let-syntax ((m (lambda (form)
>                        (let ((x 2))
>                          (syntax x)))))
>        (m)))

Although I don't have yet a complete picture of the right hygienic
macro system in mind, I'm pretty sure that identifiers from different
levels should live in separate namespaces.

Syntax-rules blurs this because it doesn't have explicit unquoting,
and a bare symbol in a syntax quotation denotes either the source
level identifier or a place where a piece of syntax is substituted,
depending on what definition is in scope. I don't like this.

With explicit unquoting there is no reason to put them in the same
namespace. It's always known which level is meant, so putting them
in the same namespace only introduces errors when they are shadowed.
You can't refer to a runtime entity from macro code nor vice versa.

The only thing which gives me uneasy feeling is that macros themselves
are meta-level entities bound to names from the runtime namespace.

Disclaimer: I never really used macros in practice.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak@xxxxxxxxxx
    ^^     http://qrnik.knm.org.pl/~qrczak/