[Cuis-dev] Namespaces?

ken.dickey at whidbey.com ken.dickey at whidbey.com
Mon May 13 07:45:35 PDT 2019


On 2019-05-13 05:21, Luciano Notarfrancesco via Cuis-dev wrote:

> Hi everybody,
> Every now and then I wish we had namespaces. What's the simplest 
> namespace-like thing that could allows us to simultaneously load two 
> packages with clashing class names?

Luciano,

There are many ways to do namespaces.

Perhaps the simplest is to have multiple #symbol hashmaps.

You probably know that 'someSring' as always yields the same symbol.
See #Symbol class>>intern:

Having a uniq hashmap for each namespace gives multiple symbols with the 
same spelling -- one per namespace.

This has also been used for multiple versions of code.  Useful when 
debugging a new version of the debugger -- just use the old, working 
code to debug the new.

The tools need to display symbols with some font/annotation so that you 
know to which namespace a symbol belongs, Code Browser needs to add 
methods using selectors in the proper namespace and so on.  Much 
confusing otherwise.

FYI,
-KenD


More information about the Cuis-dev mailing list