Collection.st
changeset 23260 12111fbb1dad
parent 23250 8a8ff6bd0cf2
child 23319 ef16ff70d461
equal deleted inserted replaced
23259:4b544a108e4e 23260:12111fbb1dad
   357      True is returned for Collection here; false for subclasses.
   357      True is returned for Collection here; false for subclasses.
   358      Abstract subclasses must redefine this again."
   358      Abstract subclasses must redefine this again."
   359 
   359 
   360     ^ self == Collection
   360     ^ self == Collection
   361 ! !
   361 ! !
       
   362 
   362 
   363 
   363 !Collection methodsFor:'Compatibility-ANSI'!
   364 !Collection methodsFor:'Compatibility-ANSI'!
   364 
   365 
   365 identityIncludes:anObject
   366 identityIncludes:anObject
   366     "return true, if the argument, anObject is in the collection.
   367     "return true, if the argument, anObject is in the collection.
  3109 
  3110 
  3110     "Created: / 28-02-2012 / 21:11:41 / cg"
  3111     "Created: / 28-02-2012 / 21:11:41 / cg"
  3111 !
  3112 !
  3112 
  3113 
  3113 doIfNotNil:aBlock
  3114 doIfNotNil:aBlock
  3114     "evaluate aBlock for each element in the collection"
  3115     "if I am a collection, then enumerate myself into aBlock.
       
  3116      if I am nil, then do nothing.
       
  3117      Otherwise, evaluate aBlock with myself as argument."
  3115 
  3118 
  3116     ^ self do:aBlock
  3119     ^ self do:aBlock
  3117 
  3120 
  3118     "Created: / 20-03-2018 / 15:37:29 / stefan"
  3121     "Created: / 20-03-2018 / 15:37:29 / stefan"
       
  3122     "Modified (comment): / 05-08-2018 / 11:26:46 / Claus Gittinger"
  3119 !
  3123 !
  3120 
  3124 
  3121 doWhileTrue:aBlock
  3125 doWhileTrue:aBlock
  3122     "evaluate the argument, aBlock for each element,
  3126     "evaluate the argument, aBlock for each element,
  3123      until the block evaluates to false.
  3127      until the block evaluates to false.