return value of errors
authorclaus
Wed, 24 Aug 1994 01:08:09 +0200
changeset 140 186976229029
parent 139 19ccaf2031c8
child 141 b530e69052e4
return value of errors
Coll.st
Collection.st
--- a/Coll.st	Wed Aug 24 01:07:34 1994 +0200
+++ b/Coll.st	Wed Aug 24 01:08:09 1994 +0200
@@ -21,7 +21,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
               All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/Attic/Coll.st,v 1.15 1994-08-22 12:28:49 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/Coll.st,v 1.16 1994-08-23 23:08:09 claus Exp $
 '!
 
 !Collection class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/Attic/Coll.st,v 1.15 1994-08-22 12:28:49 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/Coll.st,v 1.16 1994-08-23 23:08:09 claus Exp $
 "
 !
 
@@ -162,7 +162,7 @@
 errorNotKeyed
     "report an error that keyed access methods are not allowed"
 
-    self error:(self class name, 's do not respond to keyed accessing messages')
+    ^ self error:(self class name, 's do not respond to keyed accessing messages')
 ! 
 
 errorInvalidKey
@@ -180,7 +180,7 @@
     self do:[:e | ^ e].
 
     "error if collection is empty"
-    self error:'empty collection'
+    ^ self error:'empty collection'
 !
 
 last
@@ -196,7 +196,7 @@
     ].
 
     "error if collection is empty"
-    self error:'empty collection'
+    ^ self error:'empty collection'
 !
 
 anElement
@@ -461,7 +461,6 @@
 
     |newCollection|
 
-"/    newCollection := self species new.
     newCollection := self species new finalizeCopyFrom:self.
     self do:[:each | newCollection add:(aBlock value:each)].
     ^ newCollection
@@ -483,7 +482,6 @@
     |index  "{ Class: SmallInteger }" 
      newCollection|
 
-"/    newCollection := self species new.
     newCollection := self species new finalizeCopyFrom:self.
     index := 1.
     self do:[:element |
@@ -561,7 +559,6 @@
 
     |newCollection|
 
-"/    newCollection := self species new.
     newCollection := self species new finalizeCopyFrom:self.
     self do:[:each |
         (aBlock value:each) ifTrue:[newCollection add:each].
--- a/Collection.st	Wed Aug 24 01:07:34 1994 +0200
+++ b/Collection.st	Wed Aug 24 01:08:09 1994 +0200
@@ -21,7 +21,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
               All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.15 1994-08-22 12:28:49 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.16 1994-08-23 23:08:09 claus Exp $
 '!
 
 !Collection class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.15 1994-08-22 12:28:49 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.16 1994-08-23 23:08:09 claus Exp $
 "
 !
 
@@ -162,7 +162,7 @@
 errorNotKeyed
     "report an error that keyed access methods are not allowed"
 
-    self error:(self class name, 's do not respond to keyed accessing messages')
+    ^ self error:(self class name, 's do not respond to keyed accessing messages')
 ! 
 
 errorInvalidKey
@@ -180,7 +180,7 @@
     self do:[:e | ^ e].
 
     "error if collection is empty"
-    self error:'empty collection'
+    ^ self error:'empty collection'
 !
 
 last
@@ -196,7 +196,7 @@
     ].
 
     "error if collection is empty"
-    self error:'empty collection'
+    ^ self error:'empty collection'
 !
 
 anElement
@@ -461,7 +461,6 @@
 
     |newCollection|
 
-"/    newCollection := self species new.
     newCollection := self species new finalizeCopyFrom:self.
     self do:[:each | newCollection add:(aBlock value:each)].
     ^ newCollection
@@ -483,7 +482,6 @@
     |index  "{ Class: SmallInteger }" 
      newCollection|
 
-"/    newCollection := self species new.
     newCollection := self species new finalizeCopyFrom:self.
     index := 1.
     self do:[:element |
@@ -561,7 +559,6 @@
 
     |newCollection|
 
-"/    newCollection := self species new.
     newCollection := self species new finalizeCopyFrom:self.
     self do:[:each |
         (aBlock value:each) ifTrue:[newCollection add:each].