As part of the MonticellConfiguration <--> System untangling, I'm converting the #updateFromServerAtStartup preference to a PragmaPreference. Making the new preference is easy. But the preference itself is stored inside Preferences' vast Dictionary of preferences. It seems lame to just leave the key there. So what's the proper way to remove the old preference?
frank
I don't mean to be a smart-alec but... removeKey: ? :)
No, seriously, are you asking where to put the removeKey:? Perhaps in the MC post-script of that package-version?
On Fri, Jul 26, 2013 at 12:56 PM, Frank Shearar frank.shearar@gmail.com wrote:
As part of the MonticellConfiguration <--> System untangling, I'm converting the #updateFromServerAtStartup preference to a PragmaPreference. Making the new preference is easy. But the preference itself is stored inside Preferences' vast Dictionary of preferences. It seems lame to just leave the key there. So what's the proper way to remove the old preference?
frank
Yes, it's more the "where should I put the #removeKey: when I remove the preference" than "hi I am a newbie and don't know the Dictionary API" :)
Yes, ok, ah postscript could do the trick. I can't think of a better way of doing it, and it is an inherently state-changing thing.
frank
On 27 July 2013 19:28, Chris Muller asqueaker@gmail.com wrote:
I don't mean to be a smart-alec but... removeKey: ? :)
No, seriously, are you asking where to put the removeKey:? Perhaps in the MC post-script of that package-version?
On Fri, Jul 26, 2013 at 12:56 PM, Frank Shearar frank.shearar@gmail.com wrote:
As part of the MonticellConfiguration <--> System untangling, I'm converting the #updateFromServerAtStartup preference to a PragmaPreference. Making the new preference is easy. But the preference itself is stored inside Preferences' vast Dictionary of preferences. It seems lame to just leave the key there. So what's the proper way to remove the old preference?
frank
Would this post-script need to be in a configuration file? One of those packages that is guaranteed to load? Otherwise, once you have a second version of that package,the post-script won't run, correct?
How does Trunk and Post/Pre scripts work anyways? Mainly just curious.
-Chris (one of the other ones)
On Sat, Jul 27, 2013 at 12:48 PM, Frank Shearar frank.shearar@gmail.comwrote:
Yes, it's more the "where should I put the #removeKey: when I remove the preference" than "hi I am a newbie and don't know the Dictionary API" :)
Yes, ok, ah postscript could do the trick. I can't think of a better way of doing it, and it is an inherently state-changing thing.
frank
On 27 July 2013 19:28, Chris Muller asqueaker@gmail.com wrote:
I don't mean to be a smart-alec but... removeKey: ? :)
No, seriously, are you asking where to put the removeKey:? Perhaps in the MC post-script of that package-version?
On Fri, Jul 26, 2013 at 12:56 PM, Frank Shearar frank.shearar@gmail.com
wrote:
As part of the MonticellConfiguration <--> System untangling, I'm converting the #updateFromServerAtStartup preference to a PragmaPreference. Making the new preference is easy. But the preference itself is stored inside Preferences' vast Dictionary of preferences. It seems lame to just leave the key there. So what's the proper way to remove the old preference?
frank
My Inbox submission opted for an explicit source-based removal of the preference, in Preferences class >> #initialize. (Inspired by Colin Putney's method of uninstalling/reinstalling Environments, but don't blame him for my work!)
frank
On 29 July 2013 16:19, Chris Cunningham cunningham.cb@gmail.com wrote:
Would this post-script need to be in a configuration file? One of those packages that is guaranteed to load? Otherwise, once you have a second version of that package,the post-script won't run, correct?
How does Trunk and Post/Pre scripts work anyways? Mainly just curious.
-Chris (one of the other ones)
On Sat, Jul 27, 2013 at 12:48 PM, Frank Shearar frank.shearar@gmail.com wrote:
Yes, it's more the "where should I put the #removeKey: when I remove the preference" than "hi I am a newbie and don't know the Dictionary API" :)
Yes, ok, ah postscript could do the trick. I can't think of a better way of doing it, and it is an inherently state-changing thing.
frank
On 27 July 2013 19:28, Chris Muller asqueaker@gmail.com wrote:
I don't mean to be a smart-alec but... removeKey: ? :)
No, seriously, are you asking where to put the removeKey:? Perhaps in the MC post-script of that package-version?
On Fri, Jul 26, 2013 at 12:56 PM, Frank Shearar frank.shearar@gmail.com wrote:
As part of the MonticellConfiguration <--> System untangling, I'm converting the #updateFromServerAtStartup preference to a PragmaPreference. Making the new preference is easy. But the preference itself is stored inside Preferences' vast Dictionary of preferences. It seems lame to just leave the key there. So what's the proper way to remove the old preference?
frank
I don't/didn't think that #initialize was called on a package load unless the class was a new class - so that it wouldn't overwrite accumulated state since the initial load. Isn't that still the case?
worth testing in any case.
On Mon, Jul 29, 2013 at 8:45 AM, Frank Shearar frank.shearar@gmail.comwrote:
My Inbox submission opted for an explicit source-based removal of the preference, in Preferences class >> #initialize. (Inspired by Colin Putney's method of uninstalling/reinstalling Environments, but don't blame him for my work!)
frank
On 29 July 2013 16:19, Chris Cunningham cunningham.cb@gmail.com wrote:
Would this post-script need to be in a configuration file? One of those packages that is guaranteed to load? Otherwise, once you have a second version of that package,the post-script won't run, correct?
How does Trunk and Post/Pre scripts work anyways? Mainly just curious.
-Chris (one of the other ones)
On Sat, Jul 27, 2013 at 12:48 PM, Frank Shearar <frank.shearar@gmail.com
wrote:
Yes, it's more the "where should I put the #removeKey: when I remove the preference" than "hi I am a newbie and don't know the Dictionary API" :)
Yes, ok, ah postscript could do the trick. I can't think of a better way of doing it, and it is an inherently state-changing thing.
frank
On 27 July 2013 19:28, Chris Muller asqueaker@gmail.com wrote:
I don't mean to be a smart-alec but... removeKey: ? :)
No, seriously, are you asking where to put the removeKey:? Perhaps in the MC post-script of that package-version?
On Fri, Jul 26, 2013 at 12:56 PM, Frank Shearar frank.shearar@gmail.com wrote:
As part of the MonticellConfiguration <--> System untangling, I'm converting the #updateFromServerAtStartup preference to a PragmaPreference. Making the new preference is easy. But the preference itself is stored inside Preferences' vast Dictionary of preferences. It seems lame to just leave the key there. So what's the proper way to remove the old preference?
frank
FWIW, change sets have long (always?) sent #initialize to classes when that method was changed. Seems like a useful feature.
On 7/29/13 12:09 PM, Chris Cunningham wrote:
I don't/didn't think that #initialize was called on a package load unless the class was a new class - so that it wouldn't overwrite accumulated state since the initial load. Isn't that still the case?
worth testing in any case.
It works the same way with Monticello. If you modify the #initialize method, it will be sent when the Monticello package (or change set) is loaded.
Dave
On Mon, Jul 29, 2013 at 12:41:57PM -0400, Bob Arning wrote:
FWIW, change sets have long (always?) sent #initialize to classes when that method was changed. Seems like a useful feature.
On 7/29/13 12:09 PM, Chris Cunningham wrote:
I don't/didn't think that #initialize was called on a package load unless the class was a new class - so that it wouldn't overwrite accumulated state since the initial load. Isn't that still the case?
worth testing in any case.
On 2013-07-27, at 20:28, Chris Muller asqueaker@gmail.com wrote:
I don't mean to be a smart-alec but... removeKey: ? :)
... and a whole bunch of other stuff. See #removePreference:.
- Bert -
squeak-dev@lists.squeakfoundation.org