[squeak-dev] Broken scoping in a Workspace

Frank Shearar frank.shearar at gmail.com
Sat Nov 2 10:42:00 UTC 2013


a := OrderedCollection new.
(Smalltalk globals instVarNamed: 'declarations')
keysAndValuesDo: [:key :value |
a add: value].

b := OrderedCollection new.
Smalltalk allClassesAndTraitsDo: [:v | b add: value].
b

Note that value should be scoped only to the first block. That second
block should _not_ be able to see value. But it can, so (a) the code
compiles and (b) produces #(nil nil nil ...).

frank


More information about the Squeak-dev mailing list