[Cuis-dev] [RFC] Namespaces, changes to SystemDictionary, Object and a dictionary class for tracking environment implementations

Juan Vuletich juan at jvuletich.org
Mon Oct 5 08:03:24 PDT 2020


On 10/5/2020 7:22 AM, Gerald Klix via Cuis-dev wrote:
> Hi all, hi Juan,
>
> here comes the announced monster change set.
> I hope it "Carries it's own wait."
>
> I added a EnvironmentImplementationDictionary class and changed all 
> relevant methods in SystemDictionary to ask the single instance of 
> EnvironmentImplementationDictionary if some
> implementation can handle the request.
>
> It is the simplest implementation I can think
> of, that is consistent with your statement:
> "Yes. I want Cuis to be a good place for doing any kinds of 
> experiments. Adding hooks for optional pluggable behavior is a big 
> part of that."
>
> Please tell me if this is acceptable or
> to big a change.
>
>
> Best Regards,
>
> Gerald

Hi Gerald,

The size of the change is reasonable. What I'm not sure I like is the 
fact that an instance of EnvironmentImplementationDictionary still gets 
created and its code run even if there are no Environments 
implementations at all. I think it would be better not to have the new 
global, and, for example in #fillCaches, instead of what you suggest:

     self environmentImplementations
         fillClassNameCache: classNames
         andNonClassNameCache: nonClassNames.

it would be better to do something like:

     self environmentImplementationIfPresentDo: [ :environments |
         environments
             fillClassNameCache: classNames
             andNonClassNameCache: nonClassNames ].

and #environmentImplementationIfPresentDo: will only evaluate the 
argument block if there is an environment implementation to delegate to. 
This way EnvironmentImplementationDictionary is no longer needed in the 
base image.

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