[Cuis-dev] Namespaces?

Juan Vuletich juan at jvuletich.org
Mon May 13 08:47:57 PDT 2019


On 5/13/2019 11:45 AM, ken.dickey--- via Cuis-dev wrote:
> 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

Wow. I was unaware of this technique. Sounds pretty simple! Has this 
been tried?

Now it makes me want to play with namespaces. If only there was more 
time for so many interesting things to do...

Any takers?

Thanks,

-- 
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich



More information about the Cuis-dev mailing list