Next: , Previous: , Up: Bag   [Index]


1.8.2 Bag: adding

add: newObject

Add an occurrence of newObject to the receiver. Answer newObject. Fail if newObject is nil.

add: newObject withOccurrences: anInteger

If anInteger > 0, add anInteger occurrences of newObject to the receiver. If anInteger < 0, remove them. Answer newObject. Fail if newObject is nil.