Squeak and Namespaces

Michael van der Gulik mikevdg at gmail.com
Thu Nov 30 02:32:23 UTC 2006


On 11/29/06, Bert Freudenberg <bert at freudenbergs.de> wrote:
>
> Actually, that is the beauty of the proposal. Colons are already
> allowed unquoted in a symbol. #My::Class is valid right now. In this
> proposal, the compiler knows *nothing* about namespaces. It just
> permits a colon in a global identifier. It's the only syntax change.
>
>
I don't know what to think of the syntax; it smells a bit like C++. I prefer
dotted namespaces, but that's quite subjective and not really a killer
issue.

I disagree with the implementation. I personally think that the Smalltalk
SystemDictionary should be split up into multiple, nested Namespaces (which
are subclasses of Dictionary). These would have some mechanism, such as
import lists, to glue them together. At this stage, I don't have a
well-thought out alternative proposal.

The proposed implementation also doesn't solve one of the problems that
Namespaces could solve: security. I'm writing a distributed environment that
provides a sandbox for remote code; the remote code must be denied access to
the SystemDictionary for securities' sake. Instead, remotely loaded code
should only have access to particular Classes and "global variables" in the
Namespaces that the remote code has access to. The namespace of a particular
class could be stored in the class's "environment" variable.

I suppose it doesn't really matter; if I use the same notation and semantics
for resolving classes and global variables, then code would continue to
compile under both this proposal and an alternate namespacing implementation
that I'll be writing.

Michael.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20061130/6d30efc4/attachment.htm


More information about the Squeak-dev mailing list