The Inbox: Environments-cwp.5.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Environments-cwp.5.mcz

commits-2
A new version of Environments was added to project The Inbox:
http://source.squeak.org/inbox/Environments-cwp.5.mcz

==================== Summary ====================

Name: Environments-cwp.5
Author: cwp
Time: 3 August 2012, 11:47:34.492 pm
UUID: 6eeb2f90-ea58-4ef1-9ca5-7e826ac1079c
Ancestors: Environments-cmm.4

Add an #uninstall method and call it from a class initializer.

=============== Diff against Environments-cmm.4 ===============

Item was changed:
  ----- Method: Environment class>>initialize (in category 'as yet unclassified') -----
  initialize
+ self uninstall!
- self install!

Item was added:
+ ----- Method: Environment class>>uninstall (in category 'as yet unclassified') -----
+ uninstall
+ | globals sysdict |
+ self environment class == self ifFalse: [self error: 'Not installed'].
+ globals := Smalltalk globals instVarNamed: 'contents'.
+ sysdict := SystemDictionary new: globals size.
+ globals associationsDo: [:ea | sysdict add: ea].
+ Smalltalk globals becomeForward: sysdict.!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Environments-cwp.5.mcz

Eliot Miranda-2
?? Why do uninstall in the class initializer?  What am I missing?

On Fri, Aug 3, 2012 at 11:47 PM, <[hidden email]> wrote:
A new version of Environments was added to project The Inbox:
http://source.squeak.org/inbox/Environments-cwp.5.mcz

==================== Summary ====================

Name: Environments-cwp.5
Author: cwp
Time: 3 August 2012, 11:47:34.492 pm
UUID: 6eeb2f90-ea58-4ef1-9ca5-7e826ac1079c
Ancestors: Environments-cmm.4

Add an #uninstall method and call it from a class initializer.

=============== Diff against Environments-cmm.4 ===============

Item was changed:
  ----- Method: Environment class>>initialize (in category 'as yet unclassified') -----
  initialize
+       self uninstall!
-       self install!

Item was added:
+ ----- Method: Environment class>>uninstall (in category 'as yet unclassified') -----
+ uninstall
+       | globals sysdict |
+       self environment class == self ifFalse: [self error: 'Not installed'].
+       globals := Smalltalk globals instVarNamed: 'contents'.
+       sysdict := SystemDictionary new: globals size.
+       globals associationsDo: [:ea | sysdict add: ea].
+       Smalltalk globals becomeForward: sysdict.!





--
best,
Eliot



Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Environments-cwp.5.mcz

Colin Putney-3


On Sat, Aug 4, 2012 at 3:49 PM, Eliot Miranda <[hidden email]> wrote:
?? Why do uninstall in the class initializer?  What am I missing?

With Environments pushed to 4.5, I figured this would be a good way to roll it back for 4.4. Uninstalling should be a no-op if Smalltalk globals isn't an environment.

Colin


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Environments-cwp.5.mcz

Bert Freudenberg

On 05.08.2012, at 05:50, Colin Putney wrote:

>
>
> On Sat, Aug 4, 2012 at 3:49 PM, Eliot Miranda <[hidden email]> wrote:
> ?? Why do uninstall in the class initializer?  What am I missing?
>
> With Environments pushed to 4.5, I figured this would be a good way to roll it back for 4.4. Uninstalling should be a no-op if Smalltalk globals isn't an environment.

It should. It looks like it raises an error though?

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Environments-cwp.5.mcz

Colin Putney-3


On Sun, Aug 5, 2012 at 4:34 AM, Bert Freudenberg <[hidden email]> wrote:

It should. It looks like it raises an error though?

Only if you try to uninstall when it's not installed. That shouldn't be the case when updating normally. It should only get triggered if you send #uninstall some other way. 

Colin


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Environments-cwp.5.mcz

Eliot Miranda-2


On Sun, Aug 5, 2012 at 3:44 PM, Colin Putney <[hidden email]> wrote:


On Sun, Aug 5, 2012 at 4:34 AM, Bert Freudenberg <[hidden email]> wrote:

It should. It looks like it raises an error though?

Only if you try to uninstall when it's not installed. That shouldn't be the case when updating normally. It should only get triggered if you send #uninstall some other way. 

Then please could you comment the code to that effect?  This is not at all obvious. 


Colin






--
best,
Eliot