[Cuis-dev] Namespace Code Sketch

Luciano Notarfrancesco luchiano at gmail.com
Wed Jun 10 08:19:06 PDT 2020


Hi Ken, looks good, it’s different to what I was doing last week. My
experiments involved allowing $. in class names (or globals), and
considering the first part before the period as defining the namespace,
sort of fully qualified names for classes. This was following Goran’s
namespaces ideas. Your approach is also good, and it looks more like what I
tried before last week.

I’ll try your code today and see how it feels. Looking at the source code
it just feels strange that namespaces have colors, hah... I have
synesthesia but only with letters and numbers... ;)

Regarding the tools, with my last approach I found I only had to change the
rename class and rename global refactorings to consider the case of a class
moving from one namespace to another, and everything else seemed to work
fine without requiring changes. Also I think you have to make sure to keep
associations if they already exist in the environment, for example when
renaming a class, so you don’t have to recompile methods that use it.

On Wed, 10 Jun 2020 at 9:46 PM, ken.dickey--- via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:

> Greetings,
>
> I have done enough playtime to want to share a "technology preview"
>
>    https://github.com/KenDickey/PackageEnvironments
>
> As many of you have played around with this already, the idea is avoid
> name collisions when loading multiple packages with the same Class
> names, e.g. to have multiple kinds of card games from different authors
> within the same image.  The gist is to have Environments for Class name
> lookup which do not register the class names in the Smalltalk
> dictionary.
>
> To make this "the Cuis Way", there is a 'System-Environments' Feature,
> so no one has to use Environments.  Only if you want/need them.
>
> The idea is that instead of
>    Feature require: 'MyCoolFeature'.
> one does
>    Environment fromFeature: 'MyCoolFeature'.
> and everything just works.
>
> I have only done the bit of converting a loaded CodePackage, but wanted
> to get the ideas out to see if perhaps there is interest in helping me
> complete this.
>
> In particular, the refactoring and other tools will need some tweaks.
>
> Notes are in the README.md in the PackageEnvironments repo.
>
> Any way, I think things are simple enough to benefit from some early
> feedback.
>
> Not yet a complete solution, but I wanted to share before things got
> complex.
>
> As you may know, my motto is "If I make it simple enough, even I can
> implement it".  ;^)
>
> Enjoy Cuis!!
> -KenD
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20200610/f5e3482b/attachment.htm>


More information about the Cuis-dev mailing list