[squeak-dev] The Trunk: Kernel-mt.897.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Jan 31 17:16:26 UTC 2015


Marcel Taeumel uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-mt.897.mcz

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

Name: Kernel-mt.897
Author: mt
Time: 31 January 2015, 6:16:02.184 pm
UUID: 3fdc3270-04ea-1e45-a02e-1cc17c459fde
Ancestors: Kernel-eem.896

Dynamic variables will not store their default values into the process' env anymore. This supports changing the result of #default without having to terminate that process (or fiddling with the env var directly...)

=============== Diff against Kernel-eem.896 ===============

Item was changed:
  ----- Method: DynamicVariable class>>value:during: (in category 'accessing') -----
  value: anObject during: aBlock
  
+ 	| p oldValue outerScopeWasDynamic |
- 	| p oldValue |
  	p := Processor activeProcess.
+ 	outerScopeWasDynamic := true.
+ 	oldValue := p
+ 		environmentAt: self
+ 		ifAbsent: [outerScopeWasDynamic := false. nil].
- 	oldValue := p environmentAt: self ifAbsent: [self default].
  	^[
  		p environmentAt: self put: anObject.
  		aBlock value ] 
+ 			ensure: [ outerScopeWasDynamic
+ 				ifTrue: [p environmentAt: self put: oldValue]
+ 				ifFalse: [p environmentRemoveKey: self ifAbsent: []] ].!
- 			ensure: [ p environmentAt: self put: oldValue ].!



More information about the Squeak-dev mailing list