The Trunk: Kernel-nice.304.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Kernel-nice.304.mcz

commits-2
Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.304.mcz

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

Name: Kernel-nice.304
Author: nice
Time: 22 November 2009, 9:56:22 am
UUID: f7223e31-bebd-4ce9-a68d-ce87258ec6ff
Ancestors: Kernel-ul.303

cosmetic clean up of allInstancesDo: do not test == UndefinedObject, but rather override where due.

remove Metaclass>>#allInstances.
We could also remove Metaclass>>#allInstancesDo:


=============== Diff against Kernel-ul.303 ===============

Item was changed:
  ----- Method: Behavior>>allInstancesDo: (in category 'enumerating') -----
  allInstancesDo: aBlock
  "Evaluate the argument, aBlock, for each of the current instances of the
  receiver.
 
  Because aBlock might change the class of inst (for example, using become:),
  it is essential to compute next before aBlock value: inst."
  | inst next |
- self ==  UndefinedObject ifTrue: [^ aBlock value: nil].
  inst := self someInstance.
  [inst == nil]
  whileFalse:
  [
  next := inst nextInstance.
  aBlock value: inst.
  inst := next]!

Item was added:
+ ----- Method: UndefinedObject class>>allInstancesDo: (in category 'accessing') -----
+ allInstancesDo: aBlock
+ "It is well known there is a single instance"
+
+ aBlock value: nil!

Item was removed:
- ----- Method: Metaclass>>allInstances (in category 'accessing') -----
- allInstances
- thisClass class == self ifTrue:[^Array with: thisClass].
- ^super allInstances!