Eliot Miranda-2 wrote:
>
> with closures the block in allSubInstances will be a different object on
> each evaluation. Pre closures this would have been a single BlockContext
> used for each evaluation of the block (and hence non-reentrant). So you
> need to modify, e.g. by implementing allInstancesDo: in MethodContext
> class:
>
> 'From Croquet1.0beta of 11 April 2006 [latest update: #1] on 18 December
> 2009 at 9:26:47 am'!
>
> !MethodContext class methodsFor: 'hacks' stamp: 'ar 9/17/2008 16:24'!
> allInstancesDo: aBlock
> "Only count until thisContext"
> | inst next |
> inst := self someInstance.
> [inst == thisContext] whileFalse:[
> next := inst nextInstance.
> aBlock value: inst.
> inst := next]! !
>
> find it attached
>
> On Fri, Dec 18, 2009 at 7:47 AM, Stan Shepherd
> <[email protected]>wrote:
>
>>
>> Pharo image: Pharo | Pharo-core
>> PharoCore1.0rc1 Latest update: #10502
>> VM: unix - i686 - linux-gnu - Pharo0.1 of 16 May 2008 [latest update:
>> #10074]
>>
>> Steps to reproduce:
>> 1.Object allSubInstances
>>
>> It appears to be repeatedly adding its current context.
>>
>> ...Stan
>>
>> OrderedCollection>>addLast:
>> Receiver: an OrderedCollection(an Object an Object an Object an
>> Object an Object an Object an Object...etc...
>> Arguments and temporary variables:
>> newObject: [] in Object
>
>> http://n2.nabble.com/Issue-1633-Object-allSubInstances-appears-to-loop-forever-tp4187269p4187269.html
>
>
Thanks Eliot, that does catch the looping.
...Stan
--
View this message in context:
http://n2.nabble.com/Issue-1633-Object-allSubInstances-appears-to-loop-forever-tp4187269p4189628.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project