Exporting Namespaces

Michael van der Gulik mikevdg at gmail.com
Sun Feb 18 22:03:58 UTC 2007


Hi all.

I'm currently implementing hierarchical Namespaces for Squeak, which I need
for another project of mine. The current design is as follows:

- Each Namespace is a Dictionary mapping #names to "global" variables,
classes, and sub-Namespaces.
- Each Namespace has a list of imports, which is a list of other Namespaces
that are searched when a global variable name is used.

Source code here: http://www.squeaksource.com/SecureSqueak.

So when writing code, your class resides in a particular Namespace, and if
you refer to a global variable, it is searched for in that Namespace
followed by that Namespace's import list.

Currently, I've got the basic Namespace structure working, and I've been
making a special browser, based on the PlusTools browser that uses
ToolBuilder, that lets you browse a Namespace hierarchy and manage import
lists.

Now, the question: How can I get Namespaces out of an image? I've had the
following ideas, and I'd like people's comments:

- Namespace source code could be stored in squeak.sources, and filed out as
they are now but with a few changes to class definitions.

Advantages: Most tools in Squeak would probably still work.
Disadvantages: Not backwards compatible, tools will need modifying a bit.

- Namespace source code, rather than being stored in squeak.sources, could
be stored in a hierarchy of directories under individual files for each
class, with version history stored in or alongside those files.

Advantages: You can use Subversion / CVS with this approach, or in the worst
case, use a text editor.
Disadvantages: ...

- Namespace source code could be kept only in the image. Source code would
be a Text object.

Advantages: You get to keep formatting info.
Disadvantages: If the image breaks, so does your source code.

Keeping source code in the image would mean that some mechanism of importing
or exporting a Namespace tree would be needed. I've thought about  modifying
Monticello. Currently, .mcz packages contain a snapshot/source.st which
could be replaced with a directory tree of source code.

Thoughts? Can we live without changesets if you had good Monticello support?
Can squeak.sources be ditched, instead storing source code in the image?

Michael.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20070219/64dec100/attachment.htm


More information about the Squeak-dev mailing list