Collection.st
changeset 6672 c5a5a9f9f4f5
parent 6593 bd26120c15f5
child 6695 dc0a9be75187
--- a/Collection.st	Wed Jul 31 10:39:13 2002 +0200
+++ b/Collection.st	Wed Jul 31 10:39:56 2002 +0200
@@ -2338,7 +2338,10 @@
 
 max
     "return the maximum value in the receiver collection,
-     using #> to compare elements."
+     using #> to compare elements.
+     Raises an error, if the receiver is empty."
+
+    self emptyCheck.
 
     ^ self inject:nil
             into:[:maxSoFar :this | 
@@ -2349,6 +2352,9 @@
     "
      #(15 1 -9 10 5) max  
      (1 to:15) max  
+     (-1 to:-15 by:-1) max  
+     (-1 to:-15 by:-4) max  
+     (0 to:15 by:4) max     
     "
 
     "Modified: 8.1.1997 / 22:09:37 / cg"
@@ -2356,7 +2362,10 @@
 
 min
     "return the minimum value in the receiver collection,
-     using < to compare elements."
+     using < to compare elements.
+     Raises an error, if the receiver is empty."
+
+    self emptyCheck.
 
     ^ self inject:nil
             into:[:minSoFar :this | 
@@ -2367,6 +2376,8 @@
     "
      #(15 1 -9 10 5) min 
      (1 to:15) min        
+     (-1 to:-15 by:-1) min  
+     (-1 to:-15 by:-4) min  
     "
 
     "Modified: 8.1.1997 / 22:09:49 / cg"
@@ -2406,6 +2417,6 @@
 !Collection class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.126 2002-06-25 13:58:36 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.127 2002-07-31 08:39:56 cg Exp $'
 ! !
 Collection initialize!