Re: request for comments: namespace mechanism
Ralf Juengling <[email protected]> Mon, 27 Feb 2006 08:43:06 -0800 (PST)
| Newsgroups | gmane.lisp.lush.devel |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 27 Feb 2006, Raymond Martin wrote:
>> I am working on a mechanism for simulating namespaces. The
>> implementation is inspired by the package macro. Here is my
>> idea so far: Writing
>
> Perhaps you should just extend the package mechanism. The package mechanism
> defines a namespace already, that is basically what it looks like you are attempting
> anyway.
In some ways it *is* a generalization of Lush's package mechanism.
The namespace mechanism I propose is more flexible as it leaves
with the user rather than the author of a library the decision of
what names in a library should populate the global namespace. The
user controls this by means of the import statement.
Alternatively, the user may decide to not propagate any names to
the global namespace, but she still may use the more convenient
qualified names within a 'with-namespace' form.
>> The namespace form creates a mapping from unqualified names
>> ('func1' ...) to qualified names ('abc-func1') and binds it
>> to the name 'abc' using defparameter. Thus, there is an
>> object 'abc' that represents the namespace and that you may
>> pass around to other code.
>
> The current Lush package implementation has this.
I don't think so, the package macro just returns the package name
(a symbol).
Also note that the namespace mechanism I propose does not provide
any means for indicating what definitions are 'public' and what
definitions are 'private. It is just a tool to manage names and
in fact orthogonal to the notion 'public vs. private definitions'.
Thanks for youre comments, Raymond. I need to learn more about
CL's package mechanism before I can understand your other comments.
Later,
Ralf
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642