[squeak-dev] how to break 4.5...

gettimothy gettimothy at zoho.com
Tue Apr 15 22:19:32 UTC 2014

First, thanks for an awesome vid. Very informative.

myMorphs := Array new: 360.
0 to: 359 by:15 do:[:i | myMorphs at: i+1 put:((NCCurveMorph new) extent: 20 at 20; 
 center: (450 at 330) + (300 *((i degreesToRadians cos)@(i degreesToRadians sin))); yourself)].

1 to:(myMorphs size - 1) do:[:i | 
 i+1 to: myMorphs size do:[:j | 
 ((myMorphs at:i ) ~= nil and:(myMorphs at:j ) ~= nil) 
 ifTrue:[NCAAConnectorMorph fromMorph: (myMorphs at:i) toMorph:(myMorphs at:j)]]]

"tty Debug Lock"
NCAAConnectorMorph allInstances do:[:each | each lock:True].       "This locks it"
NCAAConnectorMorph allInstances inspect.                                    "about 285 instances"
Transcript clear.
NCAAConnectorMorph allInstances do:[:each | Transcript show: (each bounds);cr. ].  "works" 
NCAAConnectorMorph allInstances do:[:each | Transcript show: (each bounds);cr. each lock:true ]. "works"
NCAAConnectorMorph allInstances do:[:each | each lock:true].  "works"
True inspect.
true inspect.
NCAAConnectorMorph allInstances do:[:each | each lock:(True initializedInstance)].   "works"

I was able to recreate the lockup you described.
Changing the lock:True to lock:true (all lowercase) does not cause the lock up.

You can work through the reasoingin with the "tty Debug Lock" section in the above code.

If you do the two inspect statements at the bottom, you will see you where passing the "True class" instead of the instance "True".



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20140415/4449a730/attachment.htm

More information about the Squeak-dev mailing list