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

Re: Replacing the mzscheme module in a namespace



Quoting Ryan Culpepper:
> Is it possible to create a new namespace with a user-defined module
> bound to the module name mzscheme? 

Technically, yes.

The problem is that the module would have to be implemented in terms of
some primitive module, which would normally be `mzscheme' --- and
`mzscheme' can't be renamed.

As it turns out, `mzscheme' is a thin layer on some other modules
(e.g., `#%kernel') which could serve as the foundation for a different
`mzscheme'. But it would be messy, and those #% modules are
intentionally unspecified.

> I can't find a way to attach a module named A in one namespace to
> another namespace under the name B.

That's true -- there's no way to rename a module as it's attached to a
different namespace.

I think this limitation might not be necessary, but I'm not certain. It
would certainly have complex implications for separate compilation. In
any case, it runs against the spirit of the module system.

> I was also considering redefining the module syntax to rename
> mzscheme wherever it appeared in the initial module position:
>     (module A mzscheme ...) => (module A alt-mzscheme ...)

Without knowing what you're trying to do, I'll point out that this
violates the spirit of `module'. `module' is supposed to let a
programmer declare exactly the language used to implement some code.

Can you say more about your ultimate goal in re-defining `mzscheme'?

Matthew