Set.st
changeset 5568 826390eef742
parent 5557 f5f8d236027c
child 5608 35df47851fe7
equal deleted inserted replaced
5567:2cc43ea7394f 5568:826390eef742
   872     "return the number of set elements"
   872     "return the number of set elements"
   873 
   873 
   874     ^ tally
   874     ^ tally
   875 ! !
   875 ! !
   876 
   876 
       
   877 
   877 !Set methodsFor:'set operations'!
   878 !Set methodsFor:'set operations'!
   878 
   879 
   879 - aCollection
   880 - aCollection
   880     "return a new set containing all elements of the receiver, which are
   881     "return a new set containing all elements of the receiver, which are
   881      NOT also contained in the argument collection"
   882      NOT also contained in the argument collection"
   906 !
   907 !
   907 
   908 
   908 includes:anObject
   909 includes:anObject
   909     "return true if the argument anObject is in the receiver"
   910     "return true if the argument anObject is in the receiver"
   910 
   911 
       
   912     anObject isNil ifTrue:[
       
   913         'Set [warning]: nil is not a valid element - will be an error in later versions' errorPrintCR.
       
   914         ^ false 
       
   915     ].
   911     ^ (self find:anObject ifAbsent:0) ~~ 0
   916     ^ (self find:anObject ifAbsent:0) ~~ 0
   912 !
   917 !
   913 
   918 
   914 isEmpty
   919 isEmpty
   915     "return true if the receiver is empty"
   920     "return true if the receiver is empty"
   984 ! !
   989 ! !
   985 
   990 
   986 !Set class methodsFor:'documentation'!
   991 !Set class methodsFor:'documentation'!
   987 
   992 
   988 version
   993 version
   989     ^ '$Header: /cvs/stx/stx/libbasic/Set.st,v 1.65 2000-08-22 13:57:23 cg Exp $'
   994     ^ '$Header: /cvs/stx/stx/libbasic/Set.st,v 1.66 2000-08-30 21:24:57 cg Exp $'
   990 ! !
   995 ! !
   991 Set initialize!
   996 Set initialize!