equal
deleted
inserted
replaced
132 |
132 |
133 !Bag methodsFor:'adding & removing'! |
133 !Bag methodsFor:'adding & removing'! |
134 |
134 |
135 add:newObject |
135 add:newObject |
136 "add the argument, anObject to the receiver. |
136 "add the argument, anObject to the receiver. |
137 Returns the object. |
137 Returns the object (sigh). |
138 |
138 |
139 WARNING: do not add/remove elements while iterating over the receiver. |
139 WARNING: do not add/remove elements while iterating over the receiver. |
140 Iterate over a copy to do this." |
140 Iterate over a copy to do this." |
141 |
141 |
142 |n| |
142 |n| |
143 |
143 |
144 n := contents at:newObject ifAbsent:0. |
144 n := contents at:newObject ifAbsent:0. |
145 contents at:newObject put:(n + 1). |
145 contents at:newObject put:(n + 1). |
414 ! ! |
414 ! ! |
415 |
415 |
416 !Bag class methodsFor:'documentation'! |
416 !Bag class methodsFor:'documentation'! |
417 |
417 |
418 version |
418 version |
419 ^ '$Header: /cvs/stx/stx/libbasic/Bag.st,v 1.42 2013-01-23 17:14:50 cg Exp $' |
419 ^ '$Header: /cvs/stx/stx/libbasic/Bag.st,v 1.43 2013-03-19 09:22:44 cg Exp $' |
420 ! |
420 ! |
421 |
421 |
422 version_CVS |
422 version_CVS |
423 ^ '$Header: /cvs/stx/stx/libbasic/Bag.st,v 1.42 2013-01-23 17:14:50 cg Exp $' |
423 ^ '$Header: /cvs/stx/stx/libbasic/Bag.st,v 1.43 2013-03-19 09:22:44 cg Exp $' |
424 ! ! |
424 ! ! |
425 |
425 |