[GemStone-Smalltalk] Variables and block closure
Pierre CHANSON via GemStone-Smalltalk
gemstone-smalltalk at lists.gemtalksystems.com
Tue Mar 17 11:17:52 PDT 2015
Hi everyone,
I wonder why is that two expressions are not evaluated similarly by
Gemstone, but they are by Pharo ?
The second one is the one I would like to be working like the first one is,
in Gemstone.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[ | traversal array|
traversal := [ :a | a do: [ :e | (e isArray) ifTrue: [ traversal value: e ]
ifFalse: [ e asString ] ] ].
array := Array with: (Array with: 1 with: 4) with: #ok with: (Array with:
#henry).
traversal value: array.
] on: Error do: [:evt | evt asString]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| traversal array|
[ traversal := [ :a | a do: [ :e | (e isArray) ifTrue: [ traversal value: e
] ifFalse: [ e asString ] ] ].
array := Array with: (Array with: 1 with: 4) with: #ok with: (Array with:
#henry).
traversal value: array.
] on: Error do: [:evt | evt asString]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thank you,
Pierre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/gemstone-smalltalk/attachments/20150317/00b71f7e/attachment.html>
More information about the GemStone-Smalltalk
mailing list