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] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= _______________________________________________ GemStone-Smalltalk mailing list [hidden email] http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk |
There are some bugs in the way blocks handle variables in GemStone/S 64-bit 3.2.x (and possibly earlier; you don’t mention your version) that will be fixed in 3.3 (but probably not before; this is described internally with bug #45059).
James > On Mar 17, 2015, at 11:17 AM, Pierre CHANSON via GemStone-Smalltalk <[hidden email]> wrote: > > 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 > > _______________________________________________ > GemStone-Smalltalk mailing list > [hidden email] > http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk _______________________________________________ GemStone-Smalltalk mailing list [hidden email] http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk |
Thanks James, ok I am working on an older version, not even the last one. So here is a very good reason I should upgrade to the last version as soon as it is released. That will be some work.-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= [| traversal array result| traversal := nil. result := OrderedCollection new. traversal := [ :a :r | |rtemp| a do: [ :e | (e isArray) ifTrue: [ rtemp := OrderedCollection new. r add: rtemp. traversal value: e value: rtemp] ifFalse: [ r add: e asString ] ] ]. array := Array with: (Array with: 1 with: 4) with: #ok with: (Array with: #henry). traversal value: array value: result. result. ] on: Error do: [:evt | evt asString] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 2015-03-17 15:52 GMT-03:00 James Foster <[hidden email]>: There are some bugs in the way blocks handle variables in GemStone/S 64-bit 3.2.x (and possibly earlier; you don’t mention your version) that will be fixed in 3.3 (but probably not before; this is described internally with bug #45059). _______________________________________________ GemStone-Smalltalk mailing list [hidden email] http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk |
The simple reproducible case is as follows:
| a | [ | b | a := [a]. b := [b]. a value -> b value. ] value. "anExecBlock0->nil" By the way, 3.3 is expected to be released this year, but nothing much more specific is available.
_______________________________________________ GemStone-Smalltalk mailing list [hidden email] http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk |
Free forum by Nabble | Edit this page |