[plt-scheme] Context-specific namespaces
At Tue, 10 Jan 2006 10:34:00 +0200, Lauri Alanko wrote:
> In any case, I don't see what your argument is. Yes, the struct type
> identifier is used in other contexts besides define-struct, but in all
> contexts the expander explicitly expects a struct identifier in that
> position, and an ordinary variable is not allowed there. Likewise, a
> struct identifier is not allowed anywhere where an ordinary variable is
> expected.
Yes. I've often sometimes wondered whether multiple namespaces (within
a phase) would be better --- especially in the context of the lexer's
regexp-operator bindings. Each time, though, the benefit didn't seem
enough to depart from Scheme's single-namespace culture/expectation.
> I'm
> just asking whether separating identifiers into multiple syntactic
> contexts _can_ be done without resorting to prefix hacks.
Right now? Not really. You can invent your own namespaces through
compile-time hash tables. The problem is in module imports/exports and
local binding, because the syntax system knows about only one
namespace.
Matthew