home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_300
/
310_02
/
set.st
< prev
next >
Wrap
Text File
|
1990-04-20
|
531b
|
26 lines
Class Set :Collection
| list |
[
new
list <- List new
| add: newElement
(list includes: newElement)
ifFalse: [list add: newElement]
| remove: oldElement ifAbsent: exceptionBlock
list remove: oldElement ifAbsent: exceptionBlock
| size
^ list size
| occurrencesOf: anElement
^ (list includes: anElement) ifTrue: [1] ifFalse: [0]
| first
^ list first
| next
^ list next
]