home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_200
/
232_01
/
set.st
< prev
next >
Wrap
Text File
|
1987-06-17
|
640b
|
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
]