#instVarNamed: mixed up ?
I had the strangest problem yesterday in #40528 Define a class: Object subclass: #AAA instanceVariableNames: 'five four one three two' classVariableNames: '' category: '_UnpackagedPackage' With one method: initialize super initialize. one := 1. two := 2. three := 3. four := 4. five := 5 Open a playground and do it & go an instance: AAA new In the raw tab execute: self class allInstVarNames collect: [ :each | each -> (self instVarNamed: each) ]. Which gives you, as expected: {#five->5. #four->4. #one->1. #three->3. #two->2} Now auto generate one accessor, say for one. Play again, and now the result is: {#five->1. #four->2. #one->3. #three->4. #two->5} !? Reaccepting the class definition fixes the problem. Sven PS: this code is used by STON, NeoJSON & NeoCSV.
Ups, a bug. I will investigateâ¦
On 19 Mar 2015, at 07:51, Sven Van Caekenberghe <sven@stfx.eu> wrote:
I had the strangest problem yesterday in #40528
Define a class:
Object subclass: #AAA instanceVariableNames: 'five four one three two' classVariableNames: '' category: '_UnpackagedPackage'
With one method:
initialize super initialize. one := 1. two := 2. three := 3. four := 4. five := 5
Open a playground and do it & go an instance:
AAA new
In the raw tab execute:
self class allInstVarNames collect: [ :each | each -> (self instVarNamed: each) ].
Which gives you, as expected:
{#five->5. #four->4. #one->1. #three->3. #two->2}
Now auto generate one accessor, say for one.
Play again, and now the result is:
{#five->1. #four->2. #one->3. #three->4. #two->5}
!?
Reaccepting the class definition fixes the problem.
Sven
PS: this code is used by STON, NeoJSON & NeoCSV.
Thatâs possibly related to the problem which Sean saw with Fuel. In one image âself slotsâ and âself instanceVariablesâ answered differently ordered collections.
On 19 Mar 2015, at 07:58, Marcus Denker <marcus.denker@inria.fr> wrote:
Ups, a bug. I will investigateâ¦
On 19 Mar 2015, at 07:51, Sven Van Caekenberghe <sven@stfx.eu> wrote:
I had the strangest problem yesterday in #40528
Define a class:
Object subclass: #AAA instanceVariableNames: 'five four one three two' classVariableNames: '' category: '_UnpackagedPackage'
With one method:
initialize super initialize. one := 1. two := 2. three := 3. four := 4. five := 5
Open a playground and do it & go an instance:
AAA new
In the raw tab execute:
self class allInstVarNames collect: [ :each | each -> (self instVarNamed: each) ].
Which gives you, as expected:
{#five->5. #four->4. #one->1. #three->3. #two->2}
Now auto generate one accessor, say for one.
Play again, and now the result is:
{#five->1. #four->2. #one->3. #three->4. #two->5}
!?
Reaccepting the class definition fixes the problem.
Sven
PS: this code is used by STON, NeoJSON & NeoCSV.
Yeah, maybe, in any case, even though I reproduced it this morning in a clean image, I can no longer do so - too bad, then this just becomes noise. Sorry.
On 19 Mar 2015, at 13:34, Max Leske <maxleske@gmail.com> wrote:
Thatâs possibly related to the problem which Sean saw with Fuel. In one image âself slotsâ and âself instanceVariablesâ answered differently ordered collections.
On 19 Mar 2015, at 07:58, Marcus Denker <marcus.denker@inria.fr> wrote:
Ups, a bug. I will investigateâ¦
On 19 Mar 2015, at 07:51, Sven Van Caekenberghe <sven@stfx.eu> wrote:
I had the strangest problem yesterday in #40528
Define a class:
Object subclass: #AAA instanceVariableNames: 'five four one three two' classVariableNames: '' category: '_UnpackagedPackage'
With one method:
initialize super initialize. one := 1. two := 2. three := 3. four := 4. five := 5
Open a playground and do it & go an instance:
AAA new
In the raw tab execute:
self class allInstVarNames collect: [ :each | each -> (self instVarNamed: each) ].
Which gives you, as expected:
{#five->5. #four->4. #one->1. #three->3. #two->2}
Now auto generate one accessor, say for one.
Play again, and now the result is:
{#five->1. #four->2. #one->3. #three->4. #two->5}
!?
Reaccepting the class definition fixes the problem.
Sven
PS: this code is used by STON, NeoJSON & NeoCSV.
I could reproduce it! I added the info and a simpler case in https://pharo.fogbugz.com/f/cases/15163/instVarNamed-mixed-up I think it is related with alphabetic sorting of the instance variable names... But I don't know who is doing that. Maybe the refactoring? El jue., 19 de mar. de 2015 a la(s) 1:38 p. m., Sven Van Caekenberghe < sven@stfx.eu> escribió:
Yeah, maybe, in any case, even though I reproduced it this morning in a clean image, I can no longer do so - too bad, then this just becomes noise. Sorry.
On 19 Mar 2015, at 13:34, Max Leske <maxleske@gmail.com> wrote:
Thatâs possibly related to the problem which Sean saw with Fuel. In one image âself slotsâ and âself instanceVariablesâ answered differently ordered collections.
On 19 Mar 2015, at 07:58, Marcus Denker <marcus.denker@inria.fr> wrote:
Ups, a bug. I will investigateâ¦
On 19 Mar 2015, at 07:51, Sven Van Caekenberghe <sven@stfx.eu> wrote:
I had the strangest problem yesterday in #40528
Define a class:
Object subclass: #AAA instanceVariableNames: 'five four one three two' classVariableNames: '' category: '_UnpackagedPackage'
With one method:
initialize super initialize. one := 1. two := 2. three := 3. four := 4. five := 5
Open a playground and do it & go an instance:
AAA new
In the raw tab execute:
self class allInstVarNames collect: [ :each | each -> (self instVarNamed: each) ].
Which gives you, as expected:
{#five->5. #four->4. #one->1. #three->3. #two->2}
Now auto generate one accessor, say for one.
Play again, and now the result is:
{#five->1. #four->2. #one->3. #three->4. #two->5}
!?
Reaccepting the class definition fixes the problem.
Sven
PS: this code is used by STON, NeoJSON & NeoCSV.
participants (4)
-
Guillermo Polito -
Marcus Denker -
Max Leske -
Sven Van Caekenberghe