[ENH] Symbol Spaces
Bergel Alexandre
bergel at iam.unibe.ch
Fri May 10 15:28:52 UTC 2002
Hello Stephen,
First, thank you for being interested by modules.
Module for Squeak need some motivated people.
Anyway, I admit I do not really understand what you have done. What is different from :
(Module @ #(People)) addAssoc: (Association key: #test value: 10) export: true.
And if you have Test defined into module #(People), you can perform this :
Test>>foo
^test
and what you have done ?
Regards,
Alexandre
On Thu, May 09, 2002 at 03:56:18PM -0400, Stephen Pair wrote:
> The attached change sets should be filed-in in the following order:
>
> symspaces-preload.cs
> symspaces.cs
>
> Note, due to very careful ordering of doIts in the preload, this change
> set will not file-out properly once filed-in. These change sets were
> implemented (and tested) on a fully updated 3.3a image.
>
> These change sets implement symbol spaces. The following changes are
> made in the String hierarchy (AbstractString, AbstractSymbol,
> LocalSymbol are new classes):
>
> ...
> ArrayedCollection
> AbstractString
> AbstractSymbol
> LocalSymbol
> Symbol
> String
>
> Additionally, the following two classes are added:
>
> ...
> SymbolSpace
> GlobalSymbolSpace
>
> These changes have the (not to be overlooked) side benefit of making it
> easier to create classes that are polymorphically compatible with String
> and Symbol. Addtionally, Symbol now uses an instance of
> GlobalSymbolSpace to manage the global symbols.
>
> To create a new symbol space and add a symbol to it, do the following:
>
> SymbolSpace new intern: 'someNewLocalSymbol'
>
> The idea behind these change sets is that they might eventually get used
> to do such things as:
>
> - implement a local symbol table for each module (just add an instvar
> called "symbols" to the Module class and have it hold onto a
> SymbolSpace)
> - implement "Selector Name Spaces" by using LocalSymbols as keys in
> method dictionaries
> - implement "Instance Variable Name Spaces" with a similar technique
> (i.e. have a dictionary of "instvars" attached to an instance with
> LocalSymbols for keys)
>
> SymbolSpace includes an "owner" instance variable to make the lookup
> from a LocalSelector to the owner of the SelectorSpace quick if needed.
> Also, the refactoring might make other things (like Unicode support) a
> tad easier.
>
> - Stephen
>
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._
Bergel Alexandre http://www.iam.unibe.ch/~bergel
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^
More information about the Squeak-dev
mailing list
|