Hi Marcel,
> Preferences does not expose the dictionary. It is rather an implementation detail.
Yes, but #setPreference:toValue:during: *could* reuse #at:put:during: instead of reinventing this - though small - wheel. :-)
> there are implementations of #at:put: where a "nil" value deletes the key.
Isn't this a completely domain-specific design decision? I think we should look at this at a different level of abstraction.
> I would rather not support modifying the dictionary during "aBlock". Similar to #do: etc. in a collection.
But the semantics of an execution-around method do not need to be timeless as mentioned earlier. Imagine a morph that changes its fill style regularly while stepping, and that should be displayed with a different border style while a dialog window is open. In this example, forbidding the manipulation of extensions during aBlock would rule out the use of #at:put:during: ...
Am 07.12.2020 19:14:30 schrieb Thiede, Christoph <[hidden email]>:
I wanted to provide it as a general functionality - you could use this in many situations, for example for adding a process variable temporarily, changing a morphic extension temporarily, or maybe even to adjust a preference temporarily ... Where temporary, just for example, might mean for the duration of a test execution (which, of course, might be debugged, so is not necessarily run as an atomic operation). In all these situations, the entire system needs to be kept running without introducing any unintended sandbox effects. :-)
Von: Squeak-dev <[hidden email]> im Auftrag von tim Rowledge <[hidden email]>
Gesendet: Montag, 7. Dezember 2020 19:10:11
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] The Inbox: Collections-ct.922.mcz
> On 2020-12-07, at 10:05 AM, Thiede, Christoph <[hidden email]> wrote:
>
> IIUYC this would make it impossible to keep other changes to the dictionary after leaving the execution around method?
Absolutely. Depends on what your deeper purpose is.
tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Strange OpCodes: LAG: Load and Garble
Free forum by Nabble | Edit this page |