Hey guys, would not make much much more sense if we return the result of evaluating the block when we use dynamic variables?
Here is the patch I'm using these days:
DynamicVariable>>value: anObject during: aBlock
| p oldValue result |
p := Processor activeProcess.
oldValue := (p psValueAt: index) ifNil: [self default].
[
p psValueAt: index put: anObject.
result := aBlock value.
] ensure: [
p psValueAt: index put: oldValue
].
^ result
