[Pkg] The Treated Inbox: System-cwp.663.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Dec 9 10:23:10 UTC 2021


Marcel Taeumel uploaded a new version of System to project The Treated Inbox:
http://source.squeak.org/treated/System-cwp.663.mcz

==================== Summary ====================

Name: System-cwp.663
Author: cwp
Time: 12 January 2014, 2:17:20.037 pm
UUID: 195900d2-3b5e-42a0-833e-fa1bbc8eecfd
Ancestors: System-cwp.661

Allow the block passed to #allObjectsDo: to use #become: on its argument.

=============== Diff against System-cwp.661 ===============

Item was changed:
  ----- Method: SystemNavigation>>allObjectsDo: (in category 'query') -----
  allObjectsDo: aBlock 
  	"Evaluate the argument, aBlock, for each object in the system 
  	excluding SmallIntegers. With closures, this needs to use an end
  	marker (lastObject) since activation of the block will create new 
+ 	contexts and cause an infinite loop. nextObject must be fetched
+ 	before the block is evaluated, becase the block may use #become:
+ 	to change the identity of object"
+ 	
+ 	| object nextObject lastObject |
- 	contexts and cause an infinite loop."
- 	| object lastObject |
  	object := self someObject.
  	lastObject := Object new.
+ 	[nextObject := object nextObject.
+ 	aBlock value: object.
+ 	object := nextObject.
+ 	lastObject == object]
+ 		whileFalse.!
- 	[lastObject == object or: [0 == object]]
- 		whileFalse: [aBlock value: object.
- 			object := object nextObject]!



More information about the Packages mailing list