*** empty log message ***
authorclaus
Sat, 08 Jan 1994 17:08:02 +0100
changeset 28 4606b818d646
parent 27 d98f9dd437f7
child 29 b6577a9f8cee
*** empty log message ***
ActorStr.st
ArrColl.st
ArrayedCollection.st
Class.st
--- a/ActorStr.st	Mon Dec 20 18:32:29 1993 +0100
+++ b/ActorStr.st	Sat Jan 08 17:08:02 1994 +0100
@@ -22,6 +22,14 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
               All Rights Reserved
 
+$Header: /cvs/stx/stx/libbasic/Attic/ActorStr.st,v 1.5 1994-01-08 16:07:57 claus Exp $
+written winter 89 by claus
+'!
+
+!ActorStream class methodsFor:'documentation'!
+
+documentation
+"
 This class provides a hook for general objects to behave like Streams;
 To the outside, ActorStreams behave like streams and respond to the
 usual streams messages (i.e. nextPut:).
@@ -34,10 +42,8 @@
 nextPutBlock    <Block>   the block to evaluate for nextPut:-messages
 nextPutAllBlock <Block>   same for nextPutAll:-messages
 nextBlock       <Block>   the Block to evaluate for the next element
-
-$Header: /cvs/stx/stx/libbasic/Attic/ActorStr.st,v 1.4 1993-10-13 02:10:37 claus Exp $
-written winter 89 by claus
-'!
+"
+! !
 
 !ActorStream class methodsFor:'instance creation'!
 
--- a/ArrColl.st	Mon Dec 20 18:32:29 1993 +0100
+++ b/ArrColl.st	Sat Jan 08 17:08:02 1994 +0100
@@ -24,7 +24,7 @@
 
 ArrayedCollections are collections where the elements can be accessed via an integer index.
 
-$Header: /cvs/stx/stx/libbasic/Attic/ArrColl.st,v 1.5 1993-12-20 17:32:15 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/ArrColl.st,v 1.6 1994-01-08 16:08:00 claus Exp $
 written spring 89 by claus
 '!
 
@@ -113,6 +113,20 @@
     ^ newCollection
 ! !
 
+!ArrayedCollection methodsFor:'accessing'!
+
+at:index ifAbsent:exceptionBlock
+    "return the element at index, if the index is invalid,
+     return the value of evaluating the exceptionBlock."
+
+    (index < 1 or:[index > self size]) ifTrue:[
+        ^ exceptionBlock value
+    ].
+    ^ self at:index
+
+    "#(1 2 3) at:4 ifAbsent:['no such index']"
+! !
+
 !ArrayedCollection methodsFor:'testing'!
 
 size
--- a/ArrayedCollection.st	Mon Dec 20 18:32:29 1993 +0100
+++ b/ArrayedCollection.st	Sat Jan 08 17:08:02 1994 +0100
@@ -24,7 +24,7 @@
 
 ArrayedCollections are collections where the elements can be accessed via an integer index.
 
-$Header: /cvs/stx/stx/libbasic/ArrayedCollection.st,v 1.5 1993-12-20 17:32:15 claus Exp $
+$Header: /cvs/stx/stx/libbasic/ArrayedCollection.st,v 1.6 1994-01-08 16:08:00 claus Exp $
 written spring 89 by claus
 '!
 
@@ -113,6 +113,20 @@
     ^ newCollection
 ! !
 
+!ArrayedCollection methodsFor:'accessing'!
+
+at:index ifAbsent:exceptionBlock
+    "return the element at index, if the index is invalid,
+     return the value of evaluating the exceptionBlock."
+
+    (index < 1 or:[index > self size]) ifTrue:[
+        ^ exceptionBlock value
+    ].
+    ^ self at:index
+
+    "#(1 2 3) at:4 ifAbsent:['no such index']"
+! !
+
 !ArrayedCollection methodsFor:'testing'!
 
 size
--- a/Class.st	Mon Dec 20 18:32:29 1993 +0100
+++ b/Class.st	Sat Jan 08 17:08:02 1994 +0100
@@ -12,7 +12,7 @@
 
 ClassDescription subclass:#Class
        instanceVariableNames:'classvars comment subclasses classFileName'
-       classVariableNames:'updatingChanges'
+       classVariableNames:'UpdatingChanges'
        poolDictionaries:''
        category:'Kernel-Classes'
 !
@@ -41,23 +41,23 @@
 
 Class variables:
 
-updatingChanges <Boolean>       true if the changes-file shall be updated
+UpdatingChanges <Boolean>       true if the changes-file shall be updated
 
 WARNING: layout known by compiler and runtime system
 
-$Header: /cvs/stx/stx/libbasic/Class.st,v 1.6 1993-12-16 10:52:05 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Class.st,v 1.7 1994-01-08 16:08:02 claus Exp $
 written Spring 89 by claus
 '!
 
 !Class class methodsFor:'initialization'!
 
 initialize
-    "the classvariable 'updatingChanges' controls if changes are put
+    "the classvariable 'UpdatingChanges' controls if changes are put
      into the changes-file; normally this variable is set to true, but
      for example during fileIn or when changes are applied, it is set to false
      to prevent changes file from getting too much junk."
      
-    updatingChanges := true
+    UpdatingChanges := true
 ! !
 
 !Class class methodsFor:'creating new classes'!
@@ -575,8 +575,8 @@
 
     |prev|
 
-    prev := updatingChanges.
-    updatingChanges := aBoolean.
+    prev := UpdatingChanges.
+    UpdatingChanges := aBoolean.
     ^ prev
 !
 
@@ -585,7 +585,7 @@
 
     |aStream|
 
-    updatingChanges ifTrue:[
+    UpdatingChanges ifTrue:[
         aStream := FileStream oldFileNamed:'changes'.
         aStream isNil ifTrue:[
             aStream := FileStream newFileNamed:'changes'.