[Cuis-dev] Parser gets confused when using $| in binary selectors
Juan Vuletich
JuanVuletich at zoho.com
Sat May 14 08:49:52 PDT 2022
On 5/14/2022 4:13 AM, Hilaire Fernandes via Cuis-dev wrote:
>
> Yes it is fine.
>
> I am wondering: when executing "PreferenceNG initialize" in an image
> with vector graphics it seems to break the image. I guess a race
> condition.
>
> To avoid this situation, I suggest you edit this method as follow:
>
> PreferenceNG>>initialize
> ThePreferences ifNil: [ThePreferences _ Dictionary new].
> ...
>
> It will allow to add the new preferences from the data array and reset
> the existing ones with the default values from the array (this what
> happen when requesting a new preference already in the system, it just
> updates the existing one). A few limitation:
>
> * It will not migrate type of existing preference (should be done
> by hand by inspecting the object or removing the whole
> preference and initialize again), I prevent it by purpose so a
> user does not mess up with the type.
> * it will not remove deprecated preferences (the ones not anymore
> in the data array). Should be removed by hand.
>
> Hilaire
>
> Le 13/05/2022 à 22:42, Juan Vuletich via Cuis-dev a écrit :
>> Hilaire, please check that the use of Preference NG is reasonable.
> --
> GNU Dr. Geo
> http://drgeo.eu
> http://blog.drgeo.eu
I think that #initialize should discard everything and start anew.
Please review the attach. It creates a new dictionary, populates it, and
only then installs it as the new ThePreferences. This is a pattern that
has been used in Squeak/Cuis many times.
BTW, I removed #select:, and renamed #all to #allPreferences. I think
this makes the stuff easier to find with senders/implementors (by
reducing false polymorphism). I kept your author initials, as this is
essentially just some refactoring.
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
https://independent.academia.edu/JuanVuletich
https://www.researchgate.net/profile/Juan-Vuletich
https://patents.justia.com/inventor/juan-manuel-vuletich
https://twitter.com/JuanVuletich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20220514/8f17fddd/attachment-0001.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 5165-CuisCore-PossibleTweaksFor-PreferenceNG-2022May14-11h55m-hlsf.002.cs.st
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20220514/8f17fddd/attachment-0001.ksh>
More information about the Cuis-dev
mailing list