includes:nil - allowed, but send out a warning
authorClaus Gittinger <cg@exept.de>
Wed, 30 Aug 2000 23:24:57 +0200
changeset 5568 826390eef742
parent 5567 2cc43ea7394f
child 5569 109bc06e4438
includes:nil - allowed, but send out a warning
Set.st
--- a/Set.st	Wed Aug 30 14:35:40 2000 +0200
+++ b/Set.st	Wed Aug 30 23:24:57 2000 +0200
@@ -874,6 +874,7 @@
     ^ tally
 ! !
 
+
 !Set methodsFor:'set operations'!
 
 - aCollection
@@ -908,6 +909,10 @@
 includes:anObject
     "return true if the argument anObject is in the receiver"
 
+    anObject isNil ifTrue:[
+        'Set [warning]: nil is not a valid element - will be an error in later versions' errorPrintCR.
+        ^ false 
+    ].
     ^ (self find:anObject ifAbsent:0) ~~ 0
 !
 
@@ -986,6 +991,6 @@
 !Set class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Set.st,v 1.65 2000-08-22 13:57:23 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Set.st,v 1.66 2000-08-30 21:24:57 cg Exp $'
 ! !
 Set initialize!