*** empty log message ***
authorclaus
Wed, 13 Oct 1993 01:19:00 +0100
changeset 3 24d81bf47225
parent 2 6526dde5f3ac
child 4 31072e3cb2e3
*** empty log message ***
ActorStr.st
ArithVal.st
ArithmeticValue.st
ArrColl.st
Array.st
ArrayedCollection.st
Assoc.st
Association.st
Autoload.st
BContext.st
Bag.st
Behavior.st
Block.st
BlockContext.st
Boolean.st
ByteArray.st
CCReader.st
Character.st
Class.st
ClassCategoryReader.st
ClassDescr.st
ClassDescription.st
Coll.st
Collection.st
Context.st
Date.st
Dict.st
Dictionary.st
DirStr.st
DirectoryStream.st
DoubleArray.st
Exception.st
ExtStream.st
ExternalStream.st
False.st
FileDir.st
FileDirectory.st
FileStr.st
FileStream.st
Filename.st
Float.st
FloatArray.st
Fraction.st
IdDict.st
IdSet.st
IdentityDictionary.st
IdentitySet.st
Integer.st
Interval.st
LargeInt.st
LargeInteger.st
Link.st
LinkList.st
LinkedList.st
Magnitude.st
Message.st
Metaclass.st
Method.st
MiniDebug.st
MiniDebugger.st
MiniIns.st
MiniInspector.st
NPExtStr.st
NonPositionableExternalStream.st
Number.st
ObjMem.st
Object.st
ObjectMemory.st
OrdColl.st
OrderedCollection.st
PipeStr.st
PipeStream.st
Point.st
PosStream.st
PositionableStream.st
ProcSched.st
Process.st
ProcessorScheduler.st
RWStream.st
ReadStr.st
ReadStream.st
ReadWriteStream.st
Rectangle.st
Registry.st
Semaphore.st
SeqColl.st
SequenceableCollection.st
Set.st
Signal.st
SignalSet.st
SmallInt.st
SmallInteger.st
Smalltalk.st
SortColl.st
SortedCollection.st
Stream.st
String.st
StringCollection.st
Symbol.st
Time.st
True.st
TwoByteString.st
UIBytes.st
UndefObj.st
UndefinedObject.st
UninterpretedBytes.st
Unix.st
WriteStr.st
WriteStream.st
--- a/ActorStr.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/ActorStr.st	Wed Oct 13 01:19:00 1993 +0100
@@ -1,5 +1,5 @@
 "
- COPYRIGHT (c) 1989/90/91 by Claus Gittinger
+ COPYRIGHT (c) 1989-93 by Claus Gittinger
               All Rights Reserved
 
  This software is furnished under a license and may be used
@@ -19,7 +19,7 @@
 
 ActorStream comment:'
 
-COPYRIGHT (c) 1989/90/91 by Claus Gittinger
+COPYRIGHT (c) 1989-93 by Claus Gittinger
               All Rights Reserved
 
 This class provides a hook for general objects to behave like Streams;
@@ -35,7 +35,7 @@
 nextPutAllBlock <Block>   same for nextPutAll:-messages
 nextBlock       <Block>   the Block to evaluate for the next element
 
-@(#)ActorStr.st	2.4 92/06/28
+$Header: /cvs/stx/stx/libbasic/Attic/ActorStr.st,v 1.3 1993-10-13 00:14:10 claus Exp $
 written winter 89 by claus
 '!
 
--- a/ArithVal.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/ArithVal.st	Wed Oct 13 01:19:00 1993 +0100
@@ -31,7 +31,7 @@
 (In the old hierarchy these had to be Numbers to do that 
  - which is not quite correct)
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/ArithVal.st,v 1.3 1993-10-13 00:14:31 claus Exp $
 '!
 
 !ArithmeticValue class methodsFor:'initialization' !
--- a/ArithmeticValue.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/ArithmeticValue.st	Wed Oct 13 01:19:00 1993 +0100
@@ -31,7 +31,7 @@
 (In the old hierarchy these had to be Numbers to do that 
  - which is not quite correct)
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/ArithmeticValue.st,v 1.3 1993-10-13 00:14:31 claus Exp $
 '!
 
 !ArithmeticValue class methodsFor:'initialization' !
--- a/ArrColl.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/ArrColl.st	Wed Oct 13 01:19:00 1993 +0100
@@ -24,7 +24,7 @@
 
 ArrayedCollections are collections where the elements can be accessed via an integer index.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/ArrColl.st,v 1.3 1993-10-13 00:14:35 claus Exp $
 written spring 89 by claus
 '!
 
--- a/Array.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Array.st	Wed Oct 13 01:19:00 1993 +0100
@@ -1,5 +1,5 @@
 "
- COPYRIGHT (c) 1989-92 by Claus Gittinger
+ COPYRIGHT (c) 1989-93 by Claus Gittinger
               All Rights Reserved
 
  This software is furnished under a license and may be used
@@ -19,7 +19,7 @@
 
 Array comment:'
 
-COPYRIGHT (c) 1989-92 by Claus Gittinger
+COPYRIGHT (c) 1989-93 by Claus Gittinger
               All Rights Reserved
 
 Arrays store general objects; the size is fixed, so add/remove is not
@@ -27,11 +27,19 @@
 are used very often in the system, some methods have been tuned by
 reimplementation as primitive.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Array.st,v 1.3 1993-10-13 00:14:37 claus Exp $
 
 written spring 89 by claus
 '!
 
+!Array class methodsFor:'queries'!
+
+isBuiltInClass
+    "this class is known by the run-time-system"
+
+    ^ self == Array
+! !
+
 !Array methodsFor:'accessing'!
 
 size
--- a/ArrayedCollection.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/ArrayedCollection.st	Wed Oct 13 01:19:00 1993 +0100
@@ -24,7 +24,7 @@
 
 ArrayedCollections are collections where the elements can be accessed via an integer index.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/ArrayedCollection.st,v 1.3 1993-10-13 00:14:35 claus Exp $
 written spring 89 by claus
 '!
 
--- a/Assoc.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Assoc.st	Wed Oct 13 01:19:00 1993 +0100
@@ -31,7 +31,7 @@
 key             <Object>        the key
 value           <Object>        the value
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/Assoc.st,v 1.3 1993-10-13 00:14:40 claus Exp $
 '!
 
 !Association class methodsFor:'instance creation'!
--- a/Association.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Association.st	Wed Oct 13 01:19:00 1993 +0100
@@ -31,7 +31,7 @@
 key             <Object>        the key
 value           <Object>        the value
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Association.st,v 1.3 1993-10-13 00:14:40 claus Exp $
 '!
 
 !Association class methodsFor:'instance creation'!
--- a/Autoload.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Autoload.st	Wed Oct 13 01:19:00 1993 +0100
@@ -27,7 +27,7 @@
 files-In the corresponding code when first used. Then the cought message
 is resent to the (now existing) class.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Autoload.st,v 1.3 1993-10-13 00:14:42 claus Exp $
 written fall 91 by claus
 '!
 
--- a/BContext.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/BContext.st	Wed Oct 13 01:19:00 1993 +0100
@@ -28,7 +28,7 @@
 
 Warning: layout and size known by compiler and runtime system - do not change.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/BContext.st,v 1.3 1993-10-13 00:14:46 claus Exp $
 '!
 
 !BlockContext methodsFor:'accessing'!
--- a/Bag.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Bag.st	Wed Oct 13 01:19:00 1993 +0100
@@ -31,7 +31,7 @@
 
 contents        <Dictionary>        for each element, the number of occurrences
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Bag.st,v 1.3 1993-10-13 00:14:48 claus Exp $
 written jun 91 by claus
 '!
 
--- a/Behavior.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Behavior.st	Wed Oct 13 01:19:00 1993 +0100
@@ -38,10 +38,18 @@
 
 NOTICE: layout known by compiler and runtime system; be careful when changing
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Behavior.st,v 1.3 1993-10-13 00:14:49 claus Exp $
 written Dec 88 by claus
 '!
 
+!Behavior class methodsFor:'queries'!
+
+isBuiltInClass
+    "this class is known by the run-time-system"
+
+    ^ true
+! !
+
 !Behavior class methodsFor:'creating new classes'!
 
 new
@@ -75,13 +83,13 @@
 !Behavior methodsFor:'creating an instance of myself'!
 
 uninitializedNew
-    "same as new"
+    "same as new - only redefined in ByteArray"
 
     ^ self basicNew
 !
 
 uninitializedNew:anInteger
-    "same as new:anInteger"
+    "same as new:anInteger - only redefined in ByteArray"
 
     ^ self basicNew:anInteger
 !
@@ -180,9 +188,9 @@
                     PROTECT(self);
                     _qNew(newobj, instsize, SENDER);
                     UNPROTECT(self);
-		    if (newobj == nil) {
-			break;
-		    }
+                    if (newobj == nil) {
+                        break;
+                    }
                     _InstPtr(newobj)->o_class = self;
 #if defined(FAST_MEMSET) && ! defined(NEGATIVE_ADDRESSES)
                     /*
@@ -210,9 +218,9 @@
                     PROTECT(self);
                     _qNew(newobj, instsize, SENDER);
                     UNPROTECT(self);
-		    if (newobj == nil) {
-			break;
-		    }
+                    if (newobj == nil) {
+                        break;
+                    }
                     _InstPtr(newobj)->o_class = self;
 #if defined(FAST_MEMSET) && ! defined(NEGATIVE_ADDRESSES)
                     /*
@@ -235,9 +243,9 @@
                     PROTECT(self);
                     _qAlignedNew(newobj, instsize, SENDER);
                     UNPROTECT(self);
-		    if (newobj == nil) {
-			break;
-		    }
+                    if (newobj == nil) {
+                        break;
+                    }
                     _InstPtr(newobj)->o_class = self;
 #if defined(memset4) && ! defined(NEGATIVE_ADDRESSES)
                     /*
@@ -267,9 +275,9 @@
                     PROTECT(self);
                     _qNew(newobj, instsize, SENDER);
                     UNPROTECT(self);
-		    if (newobj == nil) {
-			break;
-		    }
+                    if (newobj == nil) {
+                        break;
+                    }
                     _InstPtr(newobj)->o_class = self;
                     op = _InstPtr(newobj)->i_instvars;
                     while (nInstVars--)
@@ -285,9 +293,9 @@
                     PROTECT(self);
                     _qNew(newobj, instsize, SENDER);
                     UNPROTECT(self);
-		    if (newobj == nil) {
-			break;
-		    }
+                    if (newobj == nil) {
+                        break;
+                    }
                     _InstPtr(newobj)->o_class = self;
                     op = _InstPtr(newobj)->i_instvars;
                     while (nInstVars--)
@@ -305,9 +313,9 @@
                     PROTECT(self);
                     _qAlignedNew(newobj, instsize, SENDER);
                     UNPROTECT(self);
-		    if (newobj == nil) {
-			break;
-		    }
+                    if (newobj == nil) {
+                        break;
+                    }
                     _InstPtr(newobj)->o_class = self;
 #if defined(memset4)
                     memset4(_InstPtr(newobj)->i_instvars, nil, nInstVars);
@@ -336,9 +344,9 @@
                         PROTECT(self);
                         _qAlignedNew(newobj, instsize, SENDER);
                         UNPROTECT(self);
-		        if (newobj == nil) {
-			    break;
-		        }
+                        if (newobj == nil) {
+                            break;
+                        }
                         _InstPtr(newobj)->o_class = self;
                         if (nInstVars) {
 #if defined(memset4)
@@ -370,11 +378,11 @@
     ] ifTrue:[
         (anInteger >= 0) ifTrue:[
             "sorry but this class has no indexed instvars - need 'new' "
-	    self isVariable ifFalse:[
+            self isVariable ifFalse:[
                 self error:'not indexed - cannot create with new:'
-	    ] ifTrue:[
-    	        ObjectMemory allocationFailureSignal raise
-	    ]
+            ] ifTrue:[
+                ObjectMemory allocationFailureSignal raise
+            ]
         ] ifFalse:[
             self error:'bad (negative) argument to new'
         ]
@@ -711,11 +719,11 @@
 sourceCodeAt:aSelector
     "return the methods source for given selector aSelector"
 
-    |index|
+    |method|
 
-    index := selectors identityIndexOf:aSelector startingAt:1.
-    (index == 0) ifTrue:[^ nil].
-    ^ (methods at:index) source
+    method := self compiledMethodAt:aSelector.
+    method isNil ifTrue:[^ nil].
+    ^ method source
 
     "True sourceCodeAt:#ifTrue:"
 !
@@ -893,22 +901,22 @@
         self isPointers ifTrue: [
             stream next. "skip instSize"
             self isVariable ifTrue: [
-		^ self basicNew: (stream nextNumber: 3)
-	    ].
+                ^ self basicNew: (stream nextNumber: 3)
+            ].
             ^ self basicNew
-	].
+        ].
 
         obj _ self basicNew: (basicSize _ stream nextNumber: 4).
         i _ 0.
         self isBytes ifTrue: [
             [(i _ i + 1) <= basicSize] whileTrue: [
                 obj basicAt: i put: stream next
-	    ]
-	] ifFalse: [
+            ]
+        ] ifFalse: [
             [(i _ i + 1) <= basicSize] whileTrue: [
                 obj basicAt: i put: stream "nextWord" nextNumber:2
-	    ]
-	].
+            ]
+        ].
         ^obj
 !
 
--- a/Block.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Block.st	Wed Oct 13 01:19:00 1993 +0100
@@ -24,7 +24,7 @@
 COPYRIGHT (c) 1989-93 by Claus Gittinger
               All Rights Reserved
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Block.st,v 1.3 1993-10-13 00:14:54 claus Exp $
 
 written spring 89 by claus
 '!
@@ -83,6 +83,14 @@
     InvalidNewSignal notifierString:'blocks are only created by the system'.
 ! !
 
+!Block class methodsFor:'queries'!
+
+isBuiltInClass
+    "this class is known by the run-time-system"
+
+    ^ true
+! !
+
 !Block class methodsFor:'instance creation'!
 
 code:codeAddress byteCode:bCode nargs:numArgs sourcePosition:sourcePos initialPC:initialPC literals:literals
--- a/BlockContext.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/BlockContext.st	Wed Oct 13 01:19:00 1993 +0100
@@ -28,7 +28,7 @@
 
 Warning: layout and size known by compiler and runtime system - do not change.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/BlockContext.st,v 1.3 1993-10-13 00:14:46 claus Exp $
 '!
 
 !BlockContext methodsFor:'accessing'!
--- a/Boolean.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Boolean.st	Wed Oct 13 01:19:00 1993 +0100
@@ -1,5 +1,5 @@
 "
- COPYRIGHT (c) 1988/89/90 by Claus Gittinger
+ COPYRIGHT (c) 1988-93 by Claus Gittinger
               All Rights Reserved
 
  This software is furnished under a license and may be used
@@ -19,7 +19,7 @@
 
 Boolean comment:'
 
-COPYRIGHT (c) 1988/89/90 by Claus Gittinger
+COPYRIGHT (c) 1988-93 by Claus Gittinger
               All Rights Reserved
 
 Boolean is an abstract class defining the common protocol for logical
@@ -35,7 +35,7 @@
 
 written 1988 by claus
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Boolean.st,v 1.3 1993-10-13 00:14:57 claus Exp $
 '!
 
 !Boolean class methodsFor:'instance creation'!
@@ -47,6 +47,14 @@
     self error:'new instances of True/False are not allowed'
 ! !
 
+!Boolean class methodsFor:'queries'!
+
+isBuiltInClass
+    "this class is known by the run-time-system"
+
+    ^ true
+! !
+
 !Boolean methodsFor:'copying'!
 
 shallowCopy
--- a/ByteArray.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/ByteArray.st	Wed Oct 13 01:19:00 1993 +0100
@@ -1,5 +1,5 @@
 "
- COPYRIGHT (c) 1989-92 by Claus Gittinger
+ COPYRIGHT (c) 1989-93 by Claus Gittinger
               All Rights Reserved
 
  This software is furnished under a license and may be used
@@ -19,17 +19,25 @@
 
 ByteArray comment:'
 
-COPYRIGHT (c) 1989-92 by Claus Gittinger
+COPYRIGHT (c) 1989-93 by Claus Gittinger
               All Rights Reserved
 
 ByteArrays store integers in the range 0..255
 unlike Smalltalk/80, my ByteArrays have fixed size - may change
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.3 1993-10-13 00:14:59 claus Exp $
 
 written spring 89 by claus
 '!
 
+!ByteArray class methodsFor:'queries'!
+
+isBuiltInClass
+    "this class is known by the run-time-system"
+
+    ^ self == ByteArray
+! !
+
 !ByteArray class methodsFor: 'binary storage'!
 
 binaryDefinitionFrom: stream manager: manager
--- a/CCReader.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/CCReader.st	Wed Oct 13 01:19:00 1993 +0100
@@ -1,5 +1,5 @@
 "
- COPYRIGHT (c) 1989-92 by Claus Gittinger
+ COPYRIGHT (c) 1989-93 by Claus Gittinger
               All Rights Reserved
 
  This software is furnished under a license and may be used
@@ -19,12 +19,12 @@
 
 ClassCategoryReader comment:'
 
-COPYRIGHT (c) 1989-92 by Claus Gittinger
+COPYRIGHT (c) 1989-93 by Claus Gittinger
              All Rights Reserved
 
 a helper class for fileIn - keeps track of class and category to filein for.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/CCReader.st,v 1.3 1993-10-13 00:15:05 claus Exp $
 written 89 by claus
 '!
 
--- a/Character.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Character.st	Wed Oct 13 01:19:00 1993 +0100
@@ -36,7 +36,7 @@
 instances for $x and, since equality check on the Character class is
 wired into the system in many places.)
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Character.st,v 1.3 1993-10-13 00:15:12 claus Exp $
 
 '!
 
@@ -101,6 +101,14 @@
 %}
 ! !
 
+!Character class methodsFor:'queries'!
+
+isBuiltInClass
+    "this class is known by the run-time-system"
+
+    ^ self == Character
+! !
+
 !Character class methodsFor:'constants'!
 
 bell
--- a/Class.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Class.st	Wed Oct 13 01:19:00 1993 +0100
@@ -45,7 +45,7 @@
 
 WARNING: layout known by compiler and runtime system
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Class.st,v 1.3 1993-10-13 00:15:14 claus Exp $
 written Spring 89 by claus
 '!
 
@@ -705,7 +705,7 @@
         aStream nextPutAll:('''---- snapshot ' ,
                             Date today printString , ' ' ,
                             Time now printString ,
-                            ' ----''!').
+                            ' ----''!!').
         aStream cr.
         aStream close
     ]
--- a/ClassCategoryReader.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/ClassCategoryReader.st	Wed Oct 13 01:19:00 1993 +0100
@@ -1,5 +1,5 @@
 "
- COPYRIGHT (c) 1989-92 by Claus Gittinger
+ COPYRIGHT (c) 1989-93 by Claus Gittinger
               All Rights Reserved
 
  This software is furnished under a license and may be used
@@ -19,12 +19,12 @@
 
 ClassCategoryReader comment:'
 
-COPYRIGHT (c) 1989-92 by Claus Gittinger
+COPYRIGHT (c) 1989-93 by Claus Gittinger
              All Rights Reserved
 
 a helper class for fileIn - keeps track of class and category to filein for.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/ClassCategoryReader.st,v 1.3 1993-10-13 00:15:05 claus Exp $
 written 89 by claus
 '!
 
--- a/ClassDescr.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/ClassDescr.st	Wed Oct 13 01:19:00 1993 +0100
@@ -32,7 +32,7 @@
 category        <String>        the classes category
 instvars        <String>        the names of the instance variables
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/ClassDescr.st,v 1.3 1993-10-13 00:15:19 claus Exp $
 '!
 
 !ClassDescription methodsFor:'accessing'!
--- a/ClassDescription.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/ClassDescription.st	Wed Oct 13 01:19:00 1993 +0100
@@ -32,7 +32,7 @@
 category        <String>        the classes category
 instvars        <String>        the names of the instance variables
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/ClassDescription.st,v 1.3 1993-10-13 00:15:19 claus Exp $
 '!
 
 !ClassDescription methodsFor:'accessing'!
--- a/Coll.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Coll.st	Wed Oct 13 01:19:00 1993 +0100
@@ -24,7 +24,7 @@
 
 Abstract superclass for all collections
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/Coll.st,v 1.3 1993-10-13 00:15:24 claus Exp $
 '!
 
 !Collection class methodsFor:'instance creation'!
@@ -248,6 +248,13 @@
     ^ self subclassResponsibility
 !
 
+keysAndValuesDo:aTwoArgBlock
+    "evaluate the argument, aBlock for every element in the collection,
+     passing both index and element as arguments."
+
+    ^ self errorNotKeyed
+!
+
 collect:aBlock
     "for each element in the receiver, evaluate the argument, aBlock
      and return a new collection with the results"
--- a/Collection.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Collection.st	Wed Oct 13 01:19:00 1993 +0100
@@ -24,7 +24,7 @@
 
 Abstract superclass for all collections
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.3 1993-10-13 00:15:24 claus Exp $
 '!
 
 !Collection class methodsFor:'instance creation'!
@@ -248,6 +248,13 @@
     ^ self subclassResponsibility
 !
 
+keysAndValuesDo:aTwoArgBlock
+    "evaluate the argument, aBlock for every element in the collection,
+     passing both index and element as arguments."
+
+    ^ self errorNotKeyed
+!
+
 collect:aBlock
     "for each element in the receiver, evaluate the argument, aBlock
      and return a new collection with the results"
--- a/Context.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Context.st	Wed Oct 13 01:19:00 1993 +0100
@@ -33,9 +33,17 @@
 
 Warning: layout and size known by the compiler and runtime system - do not change.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Context.st,v 1.3 1993-10-13 00:15:26 claus Exp $
 '!
 
+!Context class methodsFor:'queries'!
+
+isBuiltInClass
+    "this class is known by the run-time-system"
+
+    ^ true
+! !
+
 !Context methodsFor:'testing'!
 
 isContext
--- a/Date.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Date.st	Wed Oct 13 01:19:00 1993 +0100
@@ -48,9 +48,9 @@
 
 date represents a particular second in a day; since we depend on
 unix, the second is counted from 1. Jan 1970 NOT as in Smalltalk-80
-from 1. Jan 1901 !
+from 1. Jan 1901 !!
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Date.st,v 1.3 1993-10-13 00:15:29 claus Exp $
 
 written Spring 89 by claus
 '!
--- a/Dict.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Dict.st	Wed Oct 13 01:19:00 1993 +0100
@@ -26,7 +26,7 @@
 (The implementation uses two array to store the keys and values separately.)
 Searching for an element is done using a hash into the key arrlay.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/Dict.st,v 1.3 1993-10-13 00:15:31 claus Exp $
 
 written jun 91 by claus
 rewritten 92 to use hash scheme
@@ -163,7 +163,7 @@
     "remove the association under aKey from the collection.
      If it was not in the collection report an error"
 
-    |index 
+    |index "{ Class:SmallInteger }"
      next  "{ Class:SmallInteger }" |
 
     aKey isNil ifTrue:[
@@ -194,7 +194,7 @@
     "remove the association under aKey from the collection.
      If it was not in the collection return result from evaluating aBlock"
 
-    |index 
+    |index "{ Class:SmallInteger }"
      next  "{ Class:SmallInteger }" |
 
     aKey isNil ifTrue:[
@@ -258,6 +258,22 @@
     ]
 !
 
+keysAndValuesDo:aTwoArgBlock
+    "evaluate the argument, aBlock for every element in the collection,
+     passing both key and element as arguments."
+
+    |index "{ Class:SmallInteger }" |
+
+    tally == 0 ifTrue:[^ self].
+    index := 1.
+    keyArray do:[:key |
+        key notNil ifTrue:[
+            aTwoArgBlock value:key value:(valueArray basicAt:index)
+        ].
+        index := index + 1
+    ]
+!
+
 collect:aBlock
     "for each element in the receiver, evaluate the argument, aBlock
      and return a Bag with the results"
@@ -330,9 +346,7 @@
      if key was not found, and no unused slots where present"
 
     |index  "{ Class:SmallInteger }"
-     length "{ Class:SmallInteger }"
-     startIndex
-     probe|
+     length startIndex probe|
 
     length := keyArray basicSize.
     startIndex := key hash \\ length + 1.
--- a/Dictionary.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Dictionary.st	Wed Oct 13 01:19:00 1993 +0100
@@ -26,7 +26,7 @@
 (The implementation uses two array to store the keys and values separately.)
 Searching for an element is done using a hash into the key arrlay.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Dictionary.st,v 1.3 1993-10-13 00:15:31 claus Exp $
 
 written jun 91 by claus
 rewritten 92 to use hash scheme
@@ -163,7 +163,7 @@
     "remove the association under aKey from the collection.
      If it was not in the collection report an error"
 
-    |index 
+    |index "{ Class:SmallInteger }"
      next  "{ Class:SmallInteger }" |
 
     aKey isNil ifTrue:[
@@ -194,7 +194,7 @@
     "remove the association under aKey from the collection.
      If it was not in the collection return result from evaluating aBlock"
 
-    |index 
+    |index "{ Class:SmallInteger }"
      next  "{ Class:SmallInteger }" |
 
     aKey isNil ifTrue:[
@@ -258,6 +258,22 @@
     ]
 !
 
+keysAndValuesDo:aTwoArgBlock
+    "evaluate the argument, aBlock for every element in the collection,
+     passing both key and element as arguments."
+
+    |index "{ Class:SmallInteger }" |
+
+    tally == 0 ifTrue:[^ self].
+    index := 1.
+    keyArray do:[:key |
+        key notNil ifTrue:[
+            aTwoArgBlock value:key value:(valueArray basicAt:index)
+        ].
+        index := index + 1
+    ]
+!
+
 collect:aBlock
     "for each element in the receiver, evaluate the argument, aBlock
      and return a Bag with the results"
@@ -330,9 +346,7 @@
      if key was not found, and no unused slots where present"
 
     |index  "{ Class:SmallInteger }"
-     length "{ Class:SmallInteger }"
-     startIndex
-     probe|
+     length startIndex probe|
 
     length := keyArray basicSize.
     startIndex := key hash \\ length + 1.
--- a/DirStr.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/DirStr.st	Wed Oct 13 01:19:00 1993 +0100
@@ -22,7 +22,7 @@
 COPYRIGHT (c) 1989-93 by Claus Gittinger
               All Rights Reserved
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/DirStr.st,v 1.3 1993-10-13 00:15:33 claus Exp $
 '!
 
 %{
--- a/DirectoryStream.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/DirectoryStream.st	Wed Oct 13 01:19:00 1993 +0100
@@ -22,7 +22,7 @@
 COPYRIGHT (c) 1989-93 by Claus Gittinger
               All Rights Reserved
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/DirectoryStream.st,v 1.3 1993-10-13 00:15:33 claus Exp $
 '!
 
 %{
--- a/DoubleArray.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/DoubleArray.st	Wed Oct 13 01:19:00 1993 +0100
@@ -43,7 +43,7 @@
 
 See an example use in the GLX interface.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/DoubleArray.st,v 1.3 1993-10-13 00:15:40 claus Exp $
 
 written june 93 by claus
 '!
--- a/Exception.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Exception.st	Wed Oct 13 01:19:00 1993 +0100
@@ -41,6 +41,8 @@
 
 Via the Exception object, the handler can also query the state of execution,
 where the Signal was raised.
+
+$Header: /cvs/stx/stx/libbasic/Exception.st,v 1.3 1993-10-13 00:15:42 claus Exp $
 '!
 
 !Exception methodsFor:'accessing'!
--- a/ExtStream.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/ExtStream.st	Wed Oct 13 01:19:00 1993 +0100
@@ -29,7 +29,7 @@
 In text-mode, the elements read/written are characters; while in binary-mode the basic
 elements are bytes which read/write as SmallIntegers in the range 0..255.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/ExtStream.st,v 1.3 1993-10-13 00:15:47 claus Exp $
 
 written 88 by claus
 '!
--- a/ExternalStream.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/ExternalStream.st	Wed Oct 13 01:19:00 1993 +0100
@@ -29,7 +29,7 @@
 In text-mode, the elements read/written are characters; while in binary-mode the basic
 elements are bytes which read/write as SmallIntegers in the range 0..255.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.3 1993-10-13 00:15:47 claus Exp $
 
 written 88 by claus
 '!
--- a/False.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/False.st	Wed Oct 13 01:19:00 1993 +0100
@@ -1,5 +1,5 @@
 "
- COPYRIGHT (c) 1988-92 by Claus Gittinger
+ COPYRIGHT (c) 1988-93 by Claus Gittinger
 	      All Rights Reserved
 
  This software is furnished under a license and may be used
@@ -19,12 +19,12 @@
 
 False comment:'
 
-COPYRIGHT (c) 1988-92 by Claus Gittinger
+COPYRIGHT (c) 1988-93 by Claus Gittinger
 	      All Rights Reserved
 
 Class False has only one instance, false, representing logical falsehood.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/False.st,v 1.3 1993-10-13 00:15:52 claus Exp $
 '!
 
 !False methodsFor:'logical operations'!
--- a/FileDir.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/FileDir.st	Wed Oct 13 01:19:00 1993 +0100
@@ -26,7 +26,7 @@
 They provide various methods to create/delete and query for files and/or
 directories.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/FileDir.st,v 1.3 1993-10-13 00:15:54 claus Exp $
 
 written winter 89 by claus
 '!
@@ -40,7 +40,7 @@
 
 update:something
     something == #restarted ifTrue:[
-	pathOfCurrentDirectory := nil
+        pathOfCurrentDirectory := nil
     ]
 ! !
 
@@ -211,14 +211,14 @@
     char nameBuffer[MAXPATHLEN + 1];
 
     if (realpath(_stringVal(_INST(pathName)), nameBuffer)) {
-	fullPathName = _MKSTRING(nameBuffer COMMA_CON);
+        fullPathName = _MKSTRING(nameBuffer COMMA_CON);
     }
 #endif
 %}
 .
     fullPathName notNil ifTrue:[
-	pathName := fullPathName.
-	lazy := false
+        pathName := fullPathName.
+        lazy := false
     ] ifFalse:[
         "since there might be symbolic links and other stuff involved,
          better trust pwd than removing '..' by ourself
@@ -358,6 +358,16 @@
     "(FileDirectory directoryNamed:'fooBar') exists"
 !
 
+isEmpty
+    "return true, if the directory is empty;
+     redefined since '.' and '..' do not count as entries here."
+
+    self do:[:fName |
+        ((fName ~= '.') and:[fName ~= '..']) ifTrue:[^ false].
+    ].
+    ^ true
+!
+
 infoOf:name
     "return an array filled with file info for the file 'aFileName';
      return nil if such a file does not exist"
--- a/FileDirectory.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/FileDirectory.st	Wed Oct 13 01:19:00 1993 +0100
@@ -26,7 +26,7 @@
 They provide various methods to create/delete and query for files and/or
 directories.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/FileDirectory.st,v 1.3 1993-10-13 00:15:54 claus Exp $
 
 written winter 89 by claus
 '!
@@ -40,7 +40,7 @@
 
 update:something
     something == #restarted ifTrue:[
-	pathOfCurrentDirectory := nil
+        pathOfCurrentDirectory := nil
     ]
 ! !
 
@@ -211,14 +211,14 @@
     char nameBuffer[MAXPATHLEN + 1];
 
     if (realpath(_stringVal(_INST(pathName)), nameBuffer)) {
-	fullPathName = _MKSTRING(nameBuffer COMMA_CON);
+        fullPathName = _MKSTRING(nameBuffer COMMA_CON);
     }
 #endif
 %}
 .
     fullPathName notNil ifTrue:[
-	pathName := fullPathName.
-	lazy := false
+        pathName := fullPathName.
+        lazy := false
     ] ifFalse:[
         "since there might be symbolic links and other stuff involved,
          better trust pwd than removing '..' by ourself
@@ -358,6 +358,16 @@
     "(FileDirectory directoryNamed:'fooBar') exists"
 !
 
+isEmpty
+    "return true, if the directory is empty;
+     redefined since '.' and '..' do not count as entries here."
+
+    self do:[:fName |
+        ((fName ~= '.') and:[fName ~= '..']) ifTrue:[^ false].
+    ].
+    ^ true
+!
+
 infoOf:name
     "return an array filled with file info for the file 'aFileName';
      return nil if such a file does not exist"
--- a/FileStr.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/FileStr.st	Wed Oct 13 01:19:00 1993 +0100
@@ -24,7 +24,7 @@
 This class provides access to the operating systems underlying file
 system (i.e. its an interface to the stdio library).
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/FileStr.st,v 1.3 1993-10-13 00:15:56 claus Exp $
 '!
 
 %{
--- a/FileStream.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/FileStream.st	Wed Oct 13 01:19:00 1993 +0100
@@ -24,7 +24,7 @@
 This class provides access to the operating systems underlying file
 system (i.e. its an interface to the stdio library).
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/FileStream.st,v 1.3 1993-10-13 00:15:56 claus Exp $
 '!
 
 %{
--- a/Filename.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Filename.st	Wed Oct 13 01:19:00 1993 +0100
@@ -24,7 +24,7 @@
 Filenames; originally added for ST-80 compatibility, is
 taking over functionality from other classes (FileDirectory).
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.3 1993-10-13 00:16:00 claus Exp $
 '!
 
 !Filename class methodsFor:'instance creation'!
--- a/Float.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Float.st	Wed Oct 13 01:19:00 1993 +0100
@@ -22,7 +22,7 @@
 COPYRIGHT (c) 1988-93 by Claus Gittinger
               All Rights Reserved
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Float.st,v 1.3 1993-10-13 00:16:02 claus Exp $
 
 notice, that Floats are defined as Byte-array to prevent garbage collector
 from going into the value ... otherwise I needed a special case in many places.
@@ -69,6 +69,14 @@
     ^ 3.1415926535897932384626434
 ! !
 
+!Float class methodsFor:'queries'!
+
+isBuiltInClass
+    "this class is known by the run-time-system"
+
+    ^ self == Float
+! !
+
 !Float methodsFor:'copying'!
 
 shallowCopy
@@ -117,9 +125,7 @@
     if (_isSmallInteger(aNumber)) {
         result = _floatVal(self) + (double)(_intVal(aNumber));
 retResult:
-        _qAlignedNew(newFloat, sizeof(struct floatstruct), SENDER);
-        _InstPtr(newFloat)->o_class = Float;
-        _FloatInstPtr(newFloat)->f_floatvalue = result;
+	_qMKFLOAT(newFloat, result, SENDER);
         RETURN ( newFloat );
     }
     if ((aNumber != nil) && (_qClass(aNumber) == Float)) {
@@ -141,9 +147,7 @@
     if (_isSmallInteger(aNumber)) {
         result = _floatVal(self) - (double)(_intVal(aNumber));
 retResult:
-        _qAlignedNew(newFloat, sizeof(struct floatstruct), SENDER);
-        _InstPtr(newFloat)->o_class = Float;
-        _FloatInstPtr(newFloat)->f_floatvalue = result;
+	_qMKFLOAT(newFloat, result, SENDER);
         RETURN ( newFloat );
     }
     if ((aNumber != nil) && (_qClass(aNumber) == Float)) {
@@ -166,9 +170,7 @@
     if (_isSmallInteger(aNumber)) {
         result = _floatVal(self) * (double)(_intVal(aNumber));
 retResult:
-        _qAlignedNew(newFloat, sizeof(struct floatstruct), SENDER);
-        _InstPtr(newFloat)->o_class = Float;
-        _FloatInstPtr(newFloat)->f_floatvalue = result; 
+	_qMKFLOAT(newFloat, result, SENDER);
         RETURN ( newFloat );
     }
     if ((aNumber != nil) && (_qClass(aNumber) == Float)) {
@@ -192,9 +194,7 @@
         if (aNumber != _MKSMALLINT(0)) {
             result = _floatVal(self) / ( (double)_intVal(aNumber)) ;
 retResult:
-            _qAlignedNew(newFloat, sizeof(struct floatstruct), SENDER);
-            _InstPtr(newFloat)->o_class = Float;
-            _FloatInstPtr(newFloat)->f_floatvalue = result;
+	    _qMKFLOAT(newFloat, result, SENDER);
             RETURN ( newFloat );
         }
     } else {
@@ -233,7 +233,10 @@
     "return myself negated"
 
 %{  /* NOCONTEXT */
-    RETURN ( _MKFLOAT(- _floatVal(self) COMMA_SND) );
+    OBJ newFloat;
+
+    _qMKFLOAT(newFloat, - _floatVal(self), SENDER);
+    RETURN ( newFloat );
 %}
 ! !
 
--- a/FloatArray.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/FloatArray.st	Wed Oct 13 01:19:00 1993 +0100
@@ -25,7 +25,7 @@
 FloatArrays store floats (and nothing else).
 See the comment in double array for more information.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/FloatArray.st,v 1.3 1993-10-13 00:16:05 claus Exp $
 
 written june 93 by claus
 '!
--- a/Fraction.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Fraction.st	Wed Oct 13 01:19:00 1993 +0100
@@ -22,7 +22,7 @@
 COPYRIGHT (c) 1989-93 by Claus Gittinger
               All Rights Reserved
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Fraction.st,v 1.3 1993-10-13 00:16:06 claus Exp $
 '!
 
 !Fraction class methodsFor:'initialization'!
@@ -74,6 +74,14 @@
     ^ self basicNew setNumerator:num denominator:den
 ! !
 
+!Fraction class methodsFor:'queries'!
+
+isBuiltInClass
+    "this class is known by the run-time-system"
+
+    ^ self == Fraction
+! !
+
 !Fraction methodsFor:'accessing'!
 
 numerator
--- a/IdDict.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/IdDict.st	Wed Oct 13 01:19:00 1993 +0100
@@ -26,7 +26,7 @@
 Since compare is on identity keys, hashing is also done via
 identityHash instead of hash.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/IdDict.st,v 1.3 1993-10-13 00:16:10 claus Exp $
 
 written jul 92 by claus
 '!
@@ -40,9 +40,7 @@
      if key was not found, and no unused slots where present"
 
     |index  "{ Class:SmallInteger }"
-     length "{ Class:SmallInteger }"
-     startIndex
-     probe |
+     length startIndex probe |
 
     length := keyArray basicSize.
     startIndex := key identityHash \\ length + 1.
--- a/IdSet.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/IdSet.st	Wed Oct 13 01:19:00 1993 +0100
@@ -27,7 +27,7 @@
 Since compare is on identity, hashing is also done via
 identityHash instead of hash.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/IdSet.st,v 1.3 1993-10-13 00:16:12 claus Exp $
 
 written jan 93 by claus
 '!
@@ -41,9 +41,7 @@
      Redefined to compare for identity instead of equality"
 
     |index      "{ Class:SmallInteger }"
-     length     "{ Class:SmallInteger }"
-     startIndex "{ Class:SmallInteger }" 
-     probe |
+     length startIndex probe |
 
     length := contentsArray basicSize.
     startIndex := key identityHash \\ length + 1.
@@ -70,9 +68,7 @@
      identity instead of equality"
 
     |index      "{ Class:SmallInteger }"
-     length     "{ Class:SmallInteger }"
-     startIndex "{ Class:SmallInteger }"
-     probe |
+     length startIndex probe |
 
     length := contentsArray basicSize.
     startIndex := key identityHash \\ length + 1.
--- a/IdentityDictionary.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/IdentityDictionary.st	Wed Oct 13 01:19:00 1993 +0100
@@ -26,7 +26,7 @@
 Since compare is on identity keys, hashing is also done via
 identityHash instead of hash.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/IdentityDictionary.st,v 1.3 1993-10-13 00:16:10 claus Exp $
 
 written jul 92 by claus
 '!
@@ -40,9 +40,7 @@
      if key was not found, and no unused slots where present"
 
     |index  "{ Class:SmallInteger }"
-     length "{ Class:SmallInteger }"
-     startIndex
-     probe |
+     length startIndex probe |
 
     length := keyArray basicSize.
     startIndex := key identityHash \\ length + 1.
--- a/IdentitySet.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/IdentitySet.st	Wed Oct 13 01:19:00 1993 +0100
@@ -27,7 +27,7 @@
 Since compare is on identity, hashing is also done via
 identityHash instead of hash.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/IdentitySet.st,v 1.3 1993-10-13 00:16:12 claus Exp $
 
 written jan 93 by claus
 '!
@@ -41,9 +41,7 @@
      Redefined to compare for identity instead of equality"
 
     |index      "{ Class:SmallInteger }"
-     length     "{ Class:SmallInteger }"
-     startIndex "{ Class:SmallInteger }" 
-     probe |
+     length startIndex probe |
 
     length := contentsArray basicSize.
     startIndex := key identityHash \\ length + 1.
@@ -70,9 +68,7 @@
      identity instead of equality"
 
     |index      "{ Class:SmallInteger }"
-     length     "{ Class:SmallInteger }"
-     startIndex "{ Class:SmallInteger }"
-     probe |
+     length startIndex probe |
 
     length := contentsArray basicSize.
     startIndex := key identityHash \\ length + 1.
--- a/Integer.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Integer.st	Wed Oct 13 01:19:00 1993 +0100
@@ -24,7 +24,7 @@
 
 abstract superclass for all integer numbers
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Integer.st,v 1.3 1993-10-13 00:16:15 claus Exp $
 written 88 by claus
 '!
 
--- a/Interval.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Interval.st	Wed Oct 13 01:19:00 1993 +0100
@@ -27,8 +27,7 @@
 For example, the interval (1 to:5) containes the elements (1 2 3 4 5) and
 (1 to:6 by:2) contains (1 3 5).
 
-
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Interval.st,v 1.3 1993-10-13 00:16:17 claus Exp $
 
 written summer 89 by claus
 '!
--- a/LargeInt.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/LargeInt.st	Wed Oct 13 01:19:00 1993 +0100
@@ -32,7 +32,7 @@
 It will be reimplemented when everything else runs fine and a need arises
 (or someone rewrites it and sends me the code :-).
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/LargeInt.st,v 1.3 1993-10-13 00:16:19 claus Exp $
 '!
 
 !LargeInteger class methodsFor:'instance creation'!
--- a/LargeInteger.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/LargeInteger.st	Wed Oct 13 01:19:00 1993 +0100
@@ -32,7 +32,7 @@
 It will be reimplemented when everything else runs fine and a need arises
 (or someone rewrites it and sends me the code :-).
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/LargeInteger.st,v 1.3 1993-10-13 00:16:19 claus Exp $
 '!
 
 !LargeInteger class methodsFor:'instance creation'!
--- a/Link.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Link.st	Wed Oct 13 01:19:00 1993 +0100
@@ -26,7 +26,7 @@
 Links are abstract in that they do not provide a place for storing something,
 just the link-chain. For more usability look at ValueLink.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Link.st,v 1.3 1993-10-13 00:16:22 claus Exp $
 '!
 
 !Link methodsFor:'accessing'!
--- a/LinkList.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/LinkList.st	Wed Oct 13 01:19:00 1993 +0100
@@ -25,7 +25,7 @@
 this class implements an anchor to a list of Links.
 The data itself is held in the Link elements (see Link and subclasses).
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/LinkList.st,v 1.3 1993-10-13 00:16:23 claus Exp $
 '!
 
 !LinkedList class methodsFor:'instance creation'!
--- a/LinkedList.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/LinkedList.st	Wed Oct 13 01:19:00 1993 +0100
@@ -25,7 +25,7 @@
 this class implements an anchor to a list of Links.
 The data itself is held in the Link elements (see Link and subclasses).
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/LinkedList.st,v 1.3 1993-10-13 00:16:23 claus Exp $
 '!
 
 !LinkedList class methodsFor:'instance creation'!
--- a/Magnitude.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Magnitude.st	Wed Oct 13 01:19:00 1993 +0100
@@ -25,7 +25,7 @@
 This is an abstract class definining common methods for
 Objects which can be compared by a kind of greater realation.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Magnitude.st,v 1.3 1993-10-13 00:16:25 claus Exp $
 '!
 
 !Magnitude methodsFor:'comparing'!
--- a/Message.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Message.st	Wed Oct 13 01:19:00 1993 +0100
@@ -29,7 +29,7 @@
 This allows for re-evaluation of the failed send (after some cleanup).
 As an example of its use, see the implementation of the Autoload-class.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Message.st,v 1.3 1993-10-13 00:16:29 claus Exp $
 '!
 
 !Message class methodsFor:'instance creation'!
--- a/Metaclass.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Metaclass.st	Wed Oct 13 01:19:00 1993 +0100
@@ -26,7 +26,7 @@
 - this adds support for creating new subclasses or changing the definition
 of an already existing class.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Metaclass.st,v 1.3 1993-10-13 00:16:31 claus Exp $
 '!
 
 !Metaclass methodsFor:'creating classes'!
@@ -158,6 +158,12 @@
 
     superClassChange := oldClass superclass ~~ newClass superclass.
 
+    "dont allow built-in classes to be modified"
+    (oldClass notNil and:[oldClass isBuiltInClass and:[superClassChange]]) ifTrue:[
+        self error:'the inheritance of this class is fixed - you cannot change it'.
+        ^ oldClass
+    ].
+
     (superClassChange 
      and:[
         (oldClass superclass isNil or:[oldClass superclass name = newClass superclass name])
@@ -253,6 +259,13 @@
             newNames := newClass instanceVariableString asCollectionOfWords.
 
             instVarChange := (oldNames ~= newNames).
+
+            "dont allow built-in classes to be modified"
+            (oldClass notNil and:[oldClass isBuiltInClass and:[instVarChange]]) ifTrue:[
+                self error:'the layout of this class is fixed - you cannot change it'.
+                ^ oldClass
+            ].
+
             instVarChange ifTrue:[
 
                 ((oldNames size == 0) 
--- a/Method.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Method.st	Wed Oct 13 01:19:00 1993 +0100
@@ -38,10 +38,18 @@
 
 WARNING: layout known by compiler and runtime system - dont change
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Method.st,v 1.3 1993-10-13 00:16:33 claus Exp $
 written spring 89 by claus
 '!
 
+!Method class methodsFor:'queries'!
+
+isBuiltInClass
+    "this class is known by the run-time-system"
+
+    ^ self == Method
+! !
+
 !Method methodsFor:'accessing'!
 
 instVarAt:index
--- a/MiniDebug.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/MiniDebug.st	Wed Oct 13 01:19:00 1993 +0100
@@ -26,7 +26,7 @@
 graphics or when the real debugger dies (i.e. an error occurs in
 the graphical debugger).
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/MiniDebug.st,v 1.3 1993-10-13 00:16:37 claus Exp $
 '!
 
 !MiniDebugger class methodsFor: 'instance creation'!
--- a/MiniDebugger.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/MiniDebugger.st	Wed Oct 13 01:19:00 1993 +0100
@@ -26,7 +26,7 @@
 graphics or when the real debugger dies (i.e. an error occurs in
 the graphical debugger).
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/MiniDebugger.st,v 1.3 1993-10-13 00:16:37 claus Exp $
 '!
 
 !MiniDebugger class methodsFor: 'instance creation'!
--- a/MiniIns.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/MiniIns.st	Wed Oct 13 01:19:00 1993 +0100
@@ -25,7 +25,7 @@
 a primitive (non graphical) inspector for use on systems without
 graphics or when the real inspector dies.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/MiniIns.st,v 1.3 1993-10-13 00:16:39 claus Exp $
 '!
 
 !MiniInspector class methodsFor:'instance creation'!
--- a/MiniInspector.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/MiniInspector.st	Wed Oct 13 01:19:00 1993 +0100
@@ -25,7 +25,7 @@
 a primitive (non graphical) inspector for use on systems without
 graphics or when the real inspector dies.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/MiniInspector.st,v 1.3 1993-10-13 00:16:39 claus Exp $
 '!
 
 !MiniInspector class methodsFor:'instance creation'!
--- a/NPExtStr.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/NPExtStr.st	Wed Oct 13 01:19:00 1993 +0100
@@ -25,7 +25,7 @@
 this one stands all non-positionable external streams; there are
 terminal streams, pipe streams etc.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/NPExtStr.st,v 1.3 1993-10-13 00:16:43 claus Exp $
 '!
 
 %{
--- a/NonPositionableExternalStream.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/NonPositionableExternalStream.st	Wed Oct 13 01:19:00 1993 +0100
@@ -25,7 +25,7 @@
 this one stands all non-positionable external streams; there are
 terminal streams, pipe streams etc.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/NonPositionableExternalStream.st,v 1.3 1993-10-13 00:16:43 claus Exp $
 '!
 
 %{
--- a/Number.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Number.st	Wed Oct 13 01:19:00 1993 +0100
@@ -24,7 +24,7 @@
 
 abstract superclass for all kinds of numbers
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Number.st,v 1.3 1993-10-13 00:16:45 claus Exp $
 '!
 
 ! Number methodsFor:'converting' !
@@ -45,10 +45,10 @@
         _PointInstPtr(newPoint)->p_x = self;
         _PointInstPtr(newPoint)->p_y = aNumber;
         /*
-	 * no store check needed for self: self is a number, new object is definitely in newSpace
-	 * however, argument may be a context/block
-	 */
-	__STORE(newPoint, aNumber);
+         * no store check needed for self: self is a number, new object is definitely in newSpace
+         * however, argument may be a context/block
+         */
+        __STORE(newPoint, aNumber);
         RETURN ( newPoint );
     }
 %}
@@ -73,8 +73,8 @@
         _PointInstPtr(newPoint)->p_x = self;
         _PointInstPtr(newPoint)->p_y = self;
         /* 
-	 * no store check needed - its definitely in newSpace
-	 * and self is a number
+         * no store check needed - its definitely in newSpace
+         * and self is a number
          */
         RETURN ( newPoint );
     }
@@ -168,8 +168,8 @@
 !
 
 to:stop do:aBlock
-    "create an interval from the receiver up to the argument, incrementing by 1.
-     For each element of the interval, evaluate aBlock"
+    "For each element of the interval from the receiver up to the argument stop,
+     evaluate aBlock, passing the number as argument."
 
     |tmp|
 
@@ -181,8 +181,8 @@
 !
 
 to:stop by:incr do:aBlock
-    "create an interval from the receiver up to the argument stop, incrementing
-     by step. For each element of the interval, evaluate aBlock"
+    "For each element of the interval from the receiver up to the argument stop, incrementing
+     by step, evaluate aBlock passing the element as argument."
 
     |tmp|
 
@@ -229,6 +229,12 @@
     |nextChar radix value negative signExp|
 
     nextChar := aStream skipSeparators.
+
+    nextChar isNil ifTrue:[
+        "what should be returned at end-of-input ?"
+        ^ nil
+    ].
+
     (nextChar == $-) ifTrue:[
         negative := true.
         nextChar := aStream nextPeek
@@ -280,7 +286,8 @@
     ].
     ^ value
 
-    "Number readFromString:'54.32e-01'"
-    "Number readFromString:'12345678901234567890'"
-    "Number readFromString:'16rAAAAFFFFAAAAFFFF'"
+    "Number readFrom:(ReadStream on:'54.32e-01')"
+    "Number readFrom:(ReadStream on:'12345678901234567890')"
+    "Number readFrom:(ReadStream on:'16rAAAAFFFFAAAAFFFF')"
+    "Number readFrom:(ReadStream on:'(1/10)')"
 ! !
--- a/ObjMem.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/ObjMem.st	Wed Oct 13 01:19:00 1993 +0100
@@ -29,7 +29,7 @@
 COPYRIGHT (c) 1992 -93 by Claus Gittinger
              All Rights Reserved
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/ObjMem.st,v 1.3 1993-10-13 00:16:47 claus Exp $
 '!
 
 !ObjectMemory class methodsFor:'documentation'!
--- a/Object.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Object.st	Wed Oct 13 01:19:00 1993 +0100
@@ -31,7 +31,7 @@
 all objects is defined here.
 Also some utility stuff (like notify) and error handling is implemented here.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Object.st,v 1.3 1993-10-13 00:16:48 claus Exp $
 '!
 
 Smalltalk at:#ErrorRecursion put:false!
@@ -177,6 +177,14 @@
     ^ InformationSignal
 ! !
 
+!Object class methodsFor:'queries'!
+
+isBuiltInClass
+    "this class is known by the run-time-system"
+
+    ^ self == Object
+! !
+
 !Object methodsFor:'initialization'!
 
 initialize
@@ -239,6 +247,44 @@
     }
     RETURN ( _MKSMALLINT( (int)self ) );
 %}
+!
+
+changeClassTo:otherClass
+    "changes the class of the receiver to the argument, otherClass.
+     This is only allowed (possible), if the receivers class and the argument
+     have the same structure (i.e. number of named instance variables and
+     type of indexed instance variables). If the structures do not match, or any
+     of the objects is nil or a smallinteger, a primitive error is triggered."
+
+    |myClass|
+
+    myClass := self class.
+    myClass flags == otherClass flags ifTrue:[
+        myClass instSize == otherClass instSize ifTrue:[
+            "its ok to do it"
+%{
+            if (_isNonNilObject(self) 
+	     && _isNonNilObject(otherClass)
+	     && (otherClass != UndefinedObject)
+	     && (otherClass != SmallInteger)) {
+                _qClass(self) = otherClass;
+		__STORE(self, otherClass);
+                RETURN ( self );
+            }
+%}
+        ]
+    ].
+    self primitiveFailed
+!
+
+changeClassToThatOf:anObject
+    "changes the class of the receiver to that of the argument, anObject.
+     This is only allowed (possible), if the receivers class and the arguments
+     class have the same structure (i.e. number of named instance variables and 
+     type of indexed instance variables). If the structures do not match, or any
+     of the objects is nil or a smallinteger, a primitive error is triggered."
+
+    self changeClassTo:(anObject class)
 ! !
 
 !Object methodsFor:'queries'!
--- a/ObjectMemory.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/ObjectMemory.st	Wed Oct 13 01:19:00 1993 +0100
@@ -29,7 +29,7 @@
 COPYRIGHT (c) 1992 -93 by Claus Gittinger
              All Rights Reserved
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/ObjectMemory.st,v 1.3 1993-10-13 00:16:47 claus Exp $
 '!
 
 !ObjectMemory class methodsFor:'documentation'!
--- a/OrdColl.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/OrdColl.st	Wed Oct 13 01:19:00 1993 +0100
@@ -31,7 +31,7 @@
 firstIndex      <SmallInteger>  index of first valid element
 lastIndex       <SmallInteger>  index of last valid element
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/OrdColl.st,v 1.3 1993-10-13 00:16:51 claus Exp $
 written spring 89 by claus
 '!
 
@@ -356,6 +356,15 @@
     contentsArray from:firstIndex to:lastIndex do:aBlock
 !
 
+keysAndValuesDo:aTwoArgBlock
+    "evaluate the argument, aBlock for every element in the collection,
+     passing both index and element as arguments."
+
+    firstIndex to:lastIndex do:[:index |
+        aTwoArgBlock value:index value:(contentsArray at:index)
+    ]
+!
+
 collect:aBlock
     "evaluate the argument, aBlock for every element in the collection
      and return a collection of the results"
--- a/OrderedCollection.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/OrderedCollection.st	Wed Oct 13 01:19:00 1993 +0100
@@ -31,7 +31,7 @@
 firstIndex      <SmallInteger>  index of first valid element
 lastIndex       <SmallInteger>  index of last valid element
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/OrderedCollection.st,v 1.3 1993-10-13 00:16:51 claus Exp $
 written spring 89 by claus
 '!
 
@@ -356,6 +356,15 @@
     contentsArray from:firstIndex to:lastIndex do:aBlock
 !
 
+keysAndValuesDo:aTwoArgBlock
+    "evaluate the argument, aBlock for every element in the collection,
+     passing both index and element as arguments."
+
+    firstIndex to:lastIndex do:[:index |
+        aTwoArgBlock value:index value:(contentsArray at:index)
+    ]
+!
+
 collect:aBlock
     "evaluate the argument, aBlock for every element in the collection
      and return a collection of the results"
--- a/PipeStr.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/PipeStr.st	Wed Oct 13 01:19:00 1993 +0100
@@ -22,7 +22,7 @@
 COPYRIGHT (c) 1989-93 by Claus Gittinger
               All Rights Reserved
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/PipeStr.st,v 1.3 1993-10-13 00:16:55 claus Exp $
 '!
 
 %{
--- a/PipeStream.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/PipeStream.st	Wed Oct 13 01:19:00 1993 +0100
@@ -22,7 +22,7 @@
 COPYRIGHT (c) 1989-93 by Claus Gittinger
               All Rights Reserved
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/PipeStream.st,v 1.3 1993-10-13 00:16:55 claus Exp $
 '!
 
 %{
--- a/Point.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Point.st	Wed Oct 13 01:19:00 1993 +0100
@@ -33,7 +33,7 @@
 x              <Number>        the x-coordinate of myself
 y              <Number>        the y-coordinate of myself
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Point.st,v 1.3 1993-10-13 00:16:57 claus Exp $
 written 89 by claus
 '!
 
@@ -54,6 +54,14 @@
     ^ PointOne
 ! !
 
+!Point class methodsFor:'queries'!
+
+isBuiltInClass
+    "this class is known by the run-time-system"
+
+    ^ self == Point
+! !
+
 !Point class methodsFor:'instance creation'!
 
 x:newX y:newY
@@ -70,8 +78,8 @@
             _InstPtr(newPoint)->o_class = Point;
             _PointInstPtr(newPoint)->p_x = newX;
             _PointInstPtr(newPoint)->p_y = newY;
-	    __STORE(newPoint, newX);
-	    __STORE(newPoint, newY);
+            __STORE(newPoint, newX);
+            __STORE(newPoint, newY);
             RETURN ( newPoint );
         }
     }
@@ -167,9 +175,9 @@
     |p|
 
     (aPoint isMemberOf:Point) ifTrue:[
-	x ~~ (aPoint x) ifTrue:[^ false].
-	y ~~ (aPoint y) ifTrue:[^ false].
-	^ true
+        x ~~ (aPoint x) ifTrue:[^ false].
+        y ~~ (aPoint y) ifTrue:[^ false].
+        ^ true
     ].
     aPoint respondsToArithmetic ifFalse:[ ^ false].
     p := aPoint asPoint.
@@ -306,14 +314,42 @@
 !
 
 scaleBy:aScale
-    "Return a new Point that is the product of the 
+    "scale the receiver, by replacing coordinates by the product
+     of the receivers coordinated and the scale 
+     (which is a Point or Number)."
+
+    (aScale isKindOf:Point) ifFalse:[
+        x := x * aScale.
+        y := y * aScale
+    ] ifTrue:[
+        x := x * aScale x.
+        y := y * aScale y
+    ]
+!
+
+translateBy:anOffset
+    "translate the receiver, by replacing coordinates by the sum
+     of the receivers coordinated and the scale 
+     (which is a Point or Number)."
+
+    (anOffset isKindOf:Point) ifFalse:[
+        x := x + anOffset.
+        y := y + anOffset
+    ] ifTrue:[
+        x := x + anOffset x.
+        y := y + anOffset y
+    ]
+! 
+
+scaledBy:aScale
+    "return a new Point that is the product of the 
      receiver and scale (which is a Point or Number)."
 
     ^ self * aScale
 !
 
-translateBy:anOffset
-    "Return a new Point that is the sum of the 
+translatedBy:anOffset
+    "return a new Point that is the sum of the 
      receiver and scale (which is a Point or Number)."
 
     ^ self + anOffset
--- a/PosStream.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/PosStream.st	Wed Oct 13 01:19:00 1993 +0100
@@ -26,7 +26,7 @@
 I also add methods for source-chunk reading and writing
 and for filing-in/out of source code.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/PosStream.st,v 1.3 1993-10-13 00:17:00 claus Exp $
 
 TODO
    change to use signals for error handling during fileIn
--- a/PositionableStream.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/PositionableStream.st	Wed Oct 13 01:19:00 1993 +0100
@@ -26,7 +26,7 @@
 I also add methods for source-chunk reading and writing
 and for filing-in/out of source code.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.3 1993-10-13 00:17:00 claus Exp $
 
 TODO
    change to use signals for error handling during fileIn
--- a/ProcSched.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/ProcSched.st	Wed Oct 13 01:19:00 1993 +0100
@@ -25,7 +25,7 @@
 COPYRIGHT (c) 1993 by Claus Gittinger
              All Rights Reserved
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/ProcSched.st,v 1.3 1993-10-13 00:17:04 claus Exp $
 '!
 
 Smalltalk at:#Processor put:nil!
--- a/Process.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Process.st	Wed Oct 13 01:19:00 1993 +0100
@@ -22,7 +22,7 @@
 COPYRIGHT (c) 1992-93 by Claus Gittinger
              All Rights Reserved
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Process.st,v 1.3 1993-10-13 00:17:06 claus Exp $
 '!
 
 !Process methodsFor:'accessing'!
--- a/ProcessorScheduler.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/ProcessorScheduler.st	Wed Oct 13 01:19:00 1993 +0100
@@ -25,7 +25,7 @@
 COPYRIGHT (c) 1993 by Claus Gittinger
              All Rights Reserved
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.3 1993-10-13 00:17:04 claus Exp $
 '!
 
 Smalltalk at:#Processor put:nil!
--- a/RWStream.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/RWStream.st	Wed Oct 13 01:19:00 1993 +0100
@@ -22,7 +22,7 @@
 COPYRIGHT (c) 1989/90/91 by Claus Gittinger
 	      All Rights Reserved
 
-@(#)RWStream.st	2.3 92/06/06
+$Header: /cvs/stx/stx/libbasic/Attic/RWStream.st,v 1.3 1993-10-13 00:17:08 claus Exp $
 '!
 
 !ReadWriteStream methodsFor: 'access-reading'!
--- a/ReadStr.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/ReadStr.st	Wed Oct 13 01:19:00 1993 +0100
@@ -25,7 +25,7 @@
 ReadStream defines protocol for reading streamwise over collections. Code here
 is specially tuned for streaming over strings.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/ReadStr.st,v 1.3 1993-10-13 00:17:13 claus Exp $
 '!
 
 !ReadStream methodsFor:'access-reading'!
--- a/ReadStream.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/ReadStream.st	Wed Oct 13 01:19:00 1993 +0100
@@ -25,7 +25,7 @@
 ReadStream defines protocol for reading streamwise over collections. Code here
 is specially tuned for streaming over strings.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/ReadStream.st,v 1.3 1993-10-13 00:17:13 claus Exp $
 '!
 
 !ReadStream methodsFor:'access-reading'!
--- a/ReadWriteStream.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/ReadWriteStream.st	Wed Oct 13 01:19:00 1993 +0100
@@ -22,7 +22,7 @@
 COPYRIGHT (c) 1989/90/91 by Claus Gittinger
 	      All Rights Reserved
 
-@(#)RWStream.st	2.3 92/06/06
+$Header: /cvs/stx/stx/libbasic/ReadWriteStream.st,v 1.3 1993-10-13 00:17:08 claus Exp $
 '!
 
 !ReadWriteStream methodsFor: 'access-reading'!
--- a/Rectangle.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Rectangle.st	Wed Oct 13 01:19:00 1993 +0100
@@ -38,7 +38,7 @@
 width          <Number>        the width of the rectangle
 height         <Number>        the height of the rectangle
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Rectangle.st,v 1.3 1993-10-13 00:17:57 claus Exp $
 
 written 89 by claus
 '!
@@ -70,10 +70,10 @@
             _InstPtr(newRect)->i_instvars[1] = _PointInstPtr(origin)->p_y;
             _InstPtr(newRect)->i_instvars[2] = _PointInstPtr(extent)->p_x;
             _InstPtr(newRect)->i_instvars[3] = _PointInstPtr(extent)->p_y;
-	    __STORE(newRect, _PointInstPtr(origin)->p_x);
-	    __STORE(newRect, _PointInstPtr(origin)->p_y);
-	    __STORE(newRect, _PointInstPtr(extent)->p_x);
-	    __STORE(newRect, _PointInstPtr(extent)->p_y);
+            __STORE(newRect, _PointInstPtr(origin)->p_x);
+            __STORE(newRect, _PointInstPtr(origin)->p_y);
+            __STORE(newRect, _PointInstPtr(extent)->p_x);
+            __STORE(newRect, _PointInstPtr(extent)->p_y);
             RETURN ( newRect );
         }
     }
@@ -99,10 +99,10 @@
             _InstPtr(newRect)->i_instvars[1] = top;
             _InstPtr(newRect)->i_instvars[2] = w;
             _InstPtr(newRect)->i_instvars[3] = h;
-	    __STORE(newRect, left);
-	    __STORE(newRect, top);
-	    __STORE(newRect, w);
-	    __STORE(newRect, h);
+            __STORE(newRect, left);
+            __STORE(newRect, top);
+            __STORE(newRect, w);
+            __STORE(newRect, h);
             RETURN ( newRect );
         }
     }
@@ -471,6 +471,17 @@
 !
 
 translateBy:amount
+    "destructively translate (i.e. move) the receiver rectangle 
+     by amount, aPoint or Number"
+
+    |amountPoint|
+
+    amountPoint := amount asPoint.
+    left := left + amountPoint x.
+    top := top + amountPoint y
+!
+
+translatedBy:amount
     "return a new rectangle which is translated (i.e. moved)
      by amount, aPoint or Number"
 
--- a/Registry.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Registry.st	Wed Oct 13 01:19:00 1993 +0100
@@ -22,7 +22,7 @@
 COPYRIGHT (c) 1993 by Claus Gittinger
               All Rights Reserved
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Registry.st,v 1.3 1993-10-13 00:17:59 claus Exp $
 written jun 93 by claus
 '!
 
--- a/Semaphore.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Semaphore.st	Wed Oct 13 01:19:00 1993 +0100
@@ -31,7 +31,7 @@
 
 See samples in doc/coding.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Semaphore.st,v 1.3 1993-10-13 00:18:01 claus Exp $
 '!
 
 !Semaphore class methodsFor:'instance creation'!
--- a/SeqColl.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/SeqColl.st	Wed Oct 13 01:19:00 1993 +0100
@@ -26,7 +26,7 @@
 an index. SequenceableCollection is an abstract class - there are no
 instances of it in the system.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/SeqColl.st,v 1.3 1993-10-13 00:18:03 claus Exp $
 
 written spring 89 by claus
 '!
@@ -870,6 +870,21 @@
     ]
 !
 
+keysAndValuesDo:aTwoArgBlock
+    "evaluate the argument, aBlock for every element in the collection,
+     passing both index and element as arguments."
+
+    |index  "{ Class:SmallInteger }"
+     length "{ Class:SmallInteger }"|
+
+    index := 1.
+    length := self size.
+    [index <= length] whileTrue:[
+        aTwoArgBlock value:index value:(self at:index).
+        index := index + 1
+    ]
+!
+
 from:index1 to:index2 do:aBlock
     "evaluate the argument, aBlock for the elements with index index1 to
      index2 in the collection"
--- a/SequenceableCollection.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/SequenceableCollection.st	Wed Oct 13 01:19:00 1993 +0100
@@ -26,7 +26,7 @@
 an index. SequenceableCollection is an abstract class - there are no
 instances of it in the system.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.3 1993-10-13 00:18:03 claus Exp $
 
 written spring 89 by claus
 '!
@@ -870,6 +870,21 @@
     ]
 !
 
+keysAndValuesDo:aTwoArgBlock
+    "evaluate the argument, aBlock for every element in the collection,
+     passing both index and element as arguments."
+
+    |index  "{ Class:SmallInteger }"
+     length "{ Class:SmallInteger }"|
+
+    index := 1.
+    length := self size.
+    [index <= length] whileTrue:[
+        aTwoArgBlock value:index value:(self at:index).
+        index := index + 1
+    ]
+!
+
 from:index1 to:index2 do:aBlock
     "evaluate the argument, aBlock for the elements with index index1 to
      index2 in the collection"
--- a/Set.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Set.st	Wed Oct 13 01:19:00 1993 +0100
@@ -24,7 +24,7 @@
 
 a Set is a collection where each element occurs at most once.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Set.st,v 1.3 1993-10-13 00:18:06 claus Exp $
 written jun 91 by claus
 jan 93 claus: changed to use hashing
 '!
@@ -82,9 +82,7 @@
      return the value of evaluating aBlock."
 
     |index      "{ Class:SmallInteger }"
-     length     "{ Class:SmallInteger }"
-     startIndex "{ Class:SmallInteger }" 
-     probe|
+     length startIndex probe|
 
     length := contentsArray basicSize.
     startIndex := key hash \\ length + 1.
@@ -111,9 +109,7 @@
      if key was not found, and no unused slots where present"
 
     |index      "{ Class:SmallInteger }"
-     length     "{ Class:SmallInteger }"
-     startIndex "{ Class:SmallInteger }"
-     probe|
+     length startIndex probe|
 
     length := contentsArray basicSize.
     startIndex := key hash \\ length + 1.
@@ -137,7 +133,7 @@
      key is not already in the receiver - used only while growing/rehashing"
 
     |index  "{ Class:SmallInteger }"
-     length "{ Class:SmallInteger }"|
+     length|
 
     length := contentsArray basicSize.
     index := key hash \\ length + 1.
@@ -166,21 +162,21 @@
      we have to rehash (which is done by re-adding all elements to a new
      empty set)."
 
-    |oldElements oldSize
-     srcIndex "{ Class:SmallInteger }"|
+    |oldArray oldSize elem
+     n "{ Class:SmallInteger }" |
 
-    oldElements := contentsArray.
+    oldArray := contentsArray.
     oldSize := tally.
 
     contentsArray := Array new:(self goodSizeFor:newSize). 
 
-    srcIndex := 1.
-    oldElements do:[:elem |
+    n := oldArray size.
+    1 to:n do:[:srcIndex |
+        elem := oldArray basicAt:srcIndex.
         elem notNil ifTrue:[
             "cannot be already there"
             contentsArray basicAt:(self findNil:elem) put:elem
         ].
-        srcIndex := srcIndex + 1
     ].
     tally := oldSize
 !
@@ -206,7 +202,8 @@
 rehashFrom:startIndex
     "rehash elements starting at index - after a remove"
 
-    |element i length
+    |element i "{ Class:SmallInteger }"
+     length
      index "{ Class:SmallInteger }" |
 
     length := contentsArray basicSize.
--- a/Signal.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Signal.st	Wed Oct 13 01:19:00 1993 +0100
@@ -34,7 +34,7 @@
 
 See samples in doc/coding.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Signal.st,v 1.3 1993-10-13 00:18:15 claus Exp $
 '!
 
 !Signal class methodsFor:'initialization'!
--- a/SignalSet.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/SignalSet.st	Wed Oct 13 01:19:00 1993 +0100
@@ -28,7 +28,7 @@
 into the handler.
 For more detail, see comment in Signal and examples in doc/coding.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/SignalSet.st,v 1.3 1993-10-13 00:18:17 claus Exp $
 '!
 
 !SignalSet class methodsFor:'instance creation'!
--- a/SmallInt.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/SmallInt.st	Wed Oct 13 01:19:00 1993 +0100
@@ -22,15 +22,14 @@
 COPYRIGHT (c) 1988-93 by Claus Gittinger
               All Rights Reserved
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/SmallInt.st,v 1.3 1993-10-13 00:18:18 claus Exp $
 
 SmallIntegers are Integers in the range of +/- 2^30 (i.e. 31 bits).
-These are no real objects - they have no instances (not even storage !)
-and cannot be subclassed (sorry)
-
+These are no real objects - they have no instances (not even storage !!)
+and cannot be subclassed.
 The reason is to save both storage and runtime by not collecting
 SmallIntegers in the system. SmallInts are marked by having the TAG_INT 
-bit set in contrast to Objects which have not. Since this knowledge is 
+bit set in contrast to Objects which do not. Since this knowledge is 
 hardwired into the system (an there is no class-field stored with
 SmallIntegers) there can be no subclass of SmallInteger (sorry).
 '!
@@ -93,6 +92,14 @@
     "SmallInteger maxVal"
 ! !
 
+!SmallInteger class methodsFor:'queries'!
+
+isBuiltInClass
+    "this class is known by the run-time-system"
+
+    ^ true
+! !
+
 !SmallInteger methodsFor:'error catching'!
 
 at:index
@@ -642,7 +649,7 @@
                 me = _intVal(self);
                 RETURN ( _MKFLOAT((double)me / dval COMMA_CON) );
             }
-	}
+        }
     }
 %}
 .
@@ -669,20 +676,20 @@
             RETURN ( _MKSMALLINT(_intVal(self) / val) );
         }
     } else {
-	if (_isFraction(aNumber)) {
-	    OBJ t;
-	    INT num, den;
+        if (_isFraction(aNumber)) {
+            OBJ t;
+            INT num, den;
 
-	    t = _FractionInstPtr(aNumber)->f_numerator;
-	    if (_isSmallInteger(t)) {
-		num = _intVal(t);
-	        t = _FractionInstPtr(aNumber)->f_denominator;
-	        if (_isSmallInteger(t)) {
-		    den = _intVal(t);
-		    RETURN ( _MKSMALLINT(_intVal(self) * den / num ));
-	        }
-	    }
-	}
+            t = _FractionInstPtr(aNumber)->f_numerator;
+            if (_isSmallInteger(t)) {
+                num = _intVal(t);
+                t = _FractionInstPtr(aNumber)->f_denominator;
+                if (_isSmallInteger(t)) {
+                    den = _intVal(t);
+                    RETURN ( _MKSMALLINT(_intVal(self) * den / num ));
+                }
+            }
+        }
     }
 %}
 .
@@ -1369,8 +1376,19 @@
 !
 
 storeBinaryOn: stream manager: manager
-    "SmallIntegers are stored as their value with the 32nd bit set as a tag."
+    "SmallIntegers are stored as their value with the 32nd bit set as a tag.
+     To make the binary file a bit more compact, zeros are stored with a compact
+     representation."
 
+    self == 0 ifTrue:[
+        stream nextPut: manager codeForZero.
+        ^ self
+    ].
+    (self between:0 and:255) ifTrue:[
+        stream nextPut: manager codeForByteInteger.
+        stream nextPut: self.
+        ^ self
+    ].
     stream nextPut: (((self bitShift: -24) bitAnd: 16rFF) bitOr: 16r80).
     stream nextPut: ((self bitShift: -16) bitAnd: 16rFF).
     stream nextPut: ((self bitShift: -8) bitAnd: 16rFF).
--- a/SmallInteger.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/SmallInteger.st	Wed Oct 13 01:19:00 1993 +0100
@@ -22,15 +22,14 @@
 COPYRIGHT (c) 1988-93 by Claus Gittinger
               All Rights Reserved
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.3 1993-10-13 00:18:18 claus Exp $
 
 SmallIntegers are Integers in the range of +/- 2^30 (i.e. 31 bits).
-These are no real objects - they have no instances (not even storage !)
-and cannot be subclassed (sorry)
-
+These are no real objects - they have no instances (not even storage !!)
+and cannot be subclassed.
 The reason is to save both storage and runtime by not collecting
 SmallIntegers in the system. SmallInts are marked by having the TAG_INT 
-bit set in contrast to Objects which have not. Since this knowledge is 
+bit set in contrast to Objects which do not. Since this knowledge is 
 hardwired into the system (an there is no class-field stored with
 SmallIntegers) there can be no subclass of SmallInteger (sorry).
 '!
@@ -93,6 +92,14 @@
     "SmallInteger maxVal"
 ! !
 
+!SmallInteger class methodsFor:'queries'!
+
+isBuiltInClass
+    "this class is known by the run-time-system"
+
+    ^ true
+! !
+
 !SmallInteger methodsFor:'error catching'!
 
 at:index
@@ -642,7 +649,7 @@
                 me = _intVal(self);
                 RETURN ( _MKFLOAT((double)me / dval COMMA_CON) );
             }
-	}
+        }
     }
 %}
 .
@@ -669,20 +676,20 @@
             RETURN ( _MKSMALLINT(_intVal(self) / val) );
         }
     } else {
-	if (_isFraction(aNumber)) {
-	    OBJ t;
-	    INT num, den;
+        if (_isFraction(aNumber)) {
+            OBJ t;
+            INT num, den;
 
-	    t = _FractionInstPtr(aNumber)->f_numerator;
-	    if (_isSmallInteger(t)) {
-		num = _intVal(t);
-	        t = _FractionInstPtr(aNumber)->f_denominator;
-	        if (_isSmallInteger(t)) {
-		    den = _intVal(t);
-		    RETURN ( _MKSMALLINT(_intVal(self) * den / num ));
-	        }
-	    }
-	}
+            t = _FractionInstPtr(aNumber)->f_numerator;
+            if (_isSmallInteger(t)) {
+                num = _intVal(t);
+                t = _FractionInstPtr(aNumber)->f_denominator;
+                if (_isSmallInteger(t)) {
+                    den = _intVal(t);
+                    RETURN ( _MKSMALLINT(_intVal(self) * den / num ));
+                }
+            }
+        }
     }
 %}
 .
@@ -1369,8 +1376,19 @@
 !
 
 storeBinaryOn: stream manager: manager
-    "SmallIntegers are stored as their value with the 32nd bit set as a tag."
+    "SmallIntegers are stored as their value with the 32nd bit set as a tag.
+     To make the binary file a bit more compact, zeros are stored with a compact
+     representation."
 
+    self == 0 ifTrue:[
+        stream nextPut: manager codeForZero.
+        ^ self
+    ].
+    (self between:0 and:255) ifTrue:[
+        stream nextPut: manager codeForByteInteger.
+        stream nextPut: self.
+        ^ self
+    ].
     stream nextPut: (((self bitShift: -24) bitAnd: 16rFF) bitOr: 16r80).
     stream nextPut: ((self bitShift: -16) bitAnd: 16rFF).
     stream nextPut: ((self bitShift: -8) bitAnd: 16rFF).
--- a/Smalltalk.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Smalltalk.st	Wed Oct 13 01:19:00 1993 +0100
@@ -30,7 +30,7 @@
  - my implementation of globals is totally different
    (due to the need to be able to access globals from c-code as well).
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.3 1993-10-13 00:18:22 claus Exp $
 '!
 
 Smalltalk at:#ErrorNumber put:nil!
--- a/SortColl.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/SortColl.st	Wed Oct 13 01:19:00 1993 +0100
@@ -30,7 +30,7 @@
 while [:a :b | a > b] defines descening order.
 The default sortBlock for SortedCollections is the first one.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/SortColl.st,v 1.3 1993-10-13 00:18:26 claus Exp $
 '!
 
 !SortedCollection class methodsFor:'initialization'!
--- a/SortedCollection.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/SortedCollection.st	Wed Oct 13 01:19:00 1993 +0100
@@ -30,7 +30,7 @@
 while [:a :b | a > b] defines descening order.
 The default sortBlock for SortedCollections is the first one.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/SortedCollection.st,v 1.3 1993-10-13 00:18:26 claus Exp $
 '!
 
 !SortedCollection class methodsFor:'initialization'!
--- a/Stream.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Stream.st	Wed Oct 13 01:19:00 1993 +0100
@@ -22,7 +22,7 @@
 COPYRIGHT (c) 1989-93 by Claus Gittinger
               All Rights Reserved
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Stream.st,v 1.3 1993-10-13 00:18:31 claus Exp $
 '!
 
 !Stream class methodsFor:'instance creation'!
--- a/String.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/String.st	Wed Oct 13 01:19:00 1993 +0100
@@ -22,7 +22,7 @@
 COPYRIGHT (c) 1988-93 by Claus Gittinger
              All Rights Reserved
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/String.st,v 1.3 1993-10-13 00:18:32 claus Exp $
 '!
 
 %{
@@ -48,6 +48,14 @@
 "
 ! !
 
+!String class methodsFor:'queries'!
+
+isBuiltInClass
+    "this class is known by the run-time-system"
+
+    ^ self == String
+! !
+
 !String class methodsFor:'instance creation'!
 
 basicNew:anInteger
--- a/StringCollection.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/StringCollection.st	Wed Oct 13 01:19:00 1993 +0100
@@ -25,7 +25,7 @@
 text is an array of lines which are strings.
 this is just temporary - may change in the future.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/StringCollection.st,v 1.3 1993-10-13 00:18:40 claus Exp $
 '!
 
 !Text class methodsFor:'instance creation'!
--- a/Symbol.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Symbol.st	Wed Oct 13 01:19:00 1993 +0100
@@ -26,7 +26,7 @@
 exists exactly once in the system; Symbols are used for selectors, global
 variable-keys etc.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Symbol.st,v 1.3 1993-10-13 00:18:36 claus Exp $
 '!
 
 !Symbol class methodsFor:'instance creation'!
--- a/Time.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Time.st	Wed Oct 13 01:19:00 1993 +0100
@@ -27,7 +27,7 @@
 from 1. Jan 1901; since unix-time is 32 bit which does not fit into
 a SmallInteger, we keep low and hi 16bit of the time separately.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Time.st,v 1.3 1993-10-13 00:18:42 claus Exp $
 '!
 
 !Time class methodsFor:'instance creation'!
--- a/True.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/True.st	Wed Oct 13 01:19:00 1993 +0100
@@ -1,5 +1,5 @@
 "
- COPYRIGHT (c) 1988-92 by Claus Gittinger
+ COPYRIGHT (c) 1988-93 by Claus Gittinger
 	      All Rights Reserved
 
  This software is furnished under a license and may be used
@@ -19,12 +19,12 @@
 
 True comment:'
 
-COPYRIGHT (c) 1988-92 by Claus Gittinger
+COPYRIGHT (c) 1988-93 by Claus Gittinger
 	      All Rights Reserved
 
 Class True has only one instance, true, representing logical truth.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/True.st,v 1.3 1993-10-13 00:18:44 claus Exp $
 '!
 
 !True methodsFor: 'logical operations'!
--- a/TwoByteString.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/TwoByteString.st	Wed Oct 13 01:19:00 1993 +0100
@@ -25,7 +25,7 @@
 TwoByteStrings are like strings, but storing 16bits per character.
 The integration of them into the system is not completed ....
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/TwoByteString.st,v 1.3 1993-10-13 00:18:46 claus Exp $
 '!
 
 !TwoByteString class methodsFor:'instance creation'!
--- a/UIBytes.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/UIBytes.st	Wed Oct 13 01:19:00 1993 +0100
@@ -24,7 +24,7 @@
 
 this class has been added for ST-80 compatibility.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/UIBytes.st,v 1.3 1993-10-13 00:18:47 claus Exp $
 '!
 
 !UninterpretedBytes class methodsFor:'queries'!
--- a/UndefObj.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/UndefObj.st	Wed Oct 13 01:19:00 1993 +0100
@@ -1,5 +1,5 @@
 "
- COPYRIGHT (c) 1988-92 by Claus Gittinger
+ COPYRIGHT (c) 1988-93 by Claus Gittinger
 	      All Rights Reserved
 
  This software is furnished under a license and may be used
@@ -19,12 +19,12 @@
 
 UndefinedObject comment:'
 
-COPYRIGHT (c) 1988-92 by Claus Gittinger
+COPYRIGHT (c) 1988-93 by Claus Gittinger
 	      All Rights Reserved
 
 there is only one instance of this class: nil
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/UndefObj.st,v 1.3 1993-10-13 00:18:49 claus Exp $
 '!
 
 !UndefinedObject class methodsFor:'instance creation'!
--- a/UndefinedObject.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/UndefinedObject.st	Wed Oct 13 01:19:00 1993 +0100
@@ -1,5 +1,5 @@
 "
- COPYRIGHT (c) 1988-92 by Claus Gittinger
+ COPYRIGHT (c) 1988-93 by Claus Gittinger
 	      All Rights Reserved
 
  This software is furnished under a license and may be used
@@ -19,12 +19,12 @@
 
 UndefinedObject comment:'
 
-COPYRIGHT (c) 1988-92 by Claus Gittinger
+COPYRIGHT (c) 1988-93 by Claus Gittinger
 	      All Rights Reserved
 
 there is only one instance of this class: nil
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/UndefinedObject.st,v 1.3 1993-10-13 00:18:49 claus Exp $
 '!
 
 !UndefinedObject class methodsFor:'instance creation'!
--- a/UninterpretedBytes.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/UninterpretedBytes.st	Wed Oct 13 01:19:00 1993 +0100
@@ -24,7 +24,7 @@
 
 this class has been added for ST-80 compatibility.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/UninterpretedBytes.st,v 1.3 1993-10-13 00:18:47 claus Exp $
 '!
 
 !UninterpretedBytes class methodsFor:'queries'!
--- a/Unix.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/Unix.st	Wed Oct 13 01:19:00 1993 +0100
@@ -22,7 +22,7 @@
 COPYRIGHT (c) 1988-93 by Claus Gittinger
              All Rights Reserved
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/Unix.st,v 1.3 1993-10-13 00:18:51 claus Exp $
 
 written 1988 by claus
 '!
@@ -439,6 +439,12 @@
 
 !OperatingSystem class methodsFor:'error messages'!
 
+lastErrorString
+    "return a message string describing the last error"
+
+    ^ self errorTextForNumber:ErrorNumber
+!
+
 errorTextForNumber:errNr
     "return a message string from a unix errorNumber 
      (as returned by a system call). Should be replaced by
@@ -884,42 +890,17 @@
     self primitiveFailed
 !
 
-selectOn:aFileDescriptor withTimeOut:seconds
+selectOn:fd withTimeOut:seconds
     "wait for aFileDesriptor to become ready; timeout after t seconds.
      Return true, if i/o ok, false if timed-out or interrupted.
      With 0 as timeout argument, this can be used to check for availability
      of read-data.
      Experimental."
 
-    |millis|
-
-    millis := (seconds * 1000) rounded.
-%{
-    fd_set rset, wset, eset;
-    int t, fd, i, lX, bX;
-    struct timeval wt;
-
-    if ((aFileDescriptor == nil) || _isSmallInteger(aFileDescriptor)) {
-        if (_isSmallInteger(millis)) {
-            FD_ZERO(&rset);
-            FD_ZERO(&wset);
-            FD_ZERO(&eset);
-            if (aFileDescriptor != nil) {
-                fd = _intVal(aFileDescriptor);
-                if ((fd >= 0) && (fd < FD_SETSIZE))
-                    FD_SET(fd, &rset);
-            } else
-                fd = 0;
-            t = _intVal(millis);
-            wt.tv_sec = t / 1000;
-            wt.tv_usec = (t % 1000) * 1000;
-            RETURN ( (select(fd+1, &rset, &wset, &eset, &wt) == 0) ? false
-                                                                   : true );
-        }
-    }
-%}
-.
-    self primitiveFailed
+    ^ self selectOnAnyReadable:(Array with:fd)
+                      writable:(Array with:fd)
+                         error:nil
+                   withTimeOut:seconds
 !
 
 selectOn:fd1 and:fd2 withTimeOut:seconds
@@ -927,68 +908,58 @@
      Return fd if i/o ok, nil if timed-out or interrupted.
      Experimental."
 
-    |millis|
-
-    millis := (seconds * 1000) rounded.
-%{
-    fd_set rset, wset, eset;
-    int t, f1, f2, i, lX, bX;
-    struct timeval wt;
-    OBJ retFd;
-
-    if (((fd1 == nil) || _isSmallInteger(fd1)) 
-     && ((fd2 == nil) || _isSmallInteger(fd2)))  {
-        if (_isSmallInteger(millis)) {
-            FD_ZERO(&rset);
-            FD_ZERO(&wset);
-            FD_ZERO(&eset);
-            if (fd1 != nil) {
-                f1 = _intVal(fd1);
-                if ((f1 >= 0) && (f1 < FD_SETSIZE))
-                    FD_SET(f1, &rset);
-            } else
-                f1 = 0;
-            if (fd2 != nil) {
-                f2 = _intVal(fd2);
-                if ((f2 >= 0) && (f2 < FD_SETSIZE))
-                    FD_SET(f2, &rset);
-            } else
-                f2 = 0;
-            if (f2 > f1)
-                f1 = f2;
-            t = _intVal(millis);
-            wt.tv_sec = t / 1000;
-            wt.tv_usec = (t % 1000) * 1000;
-            if (select(f1+1, &rset, &wset, &eset, &wt)) {
-                if (FD_ISSET(f1, &rset)) retFd = fd1;
-                else if (FD_ISSET(f1, &wset)) retFd = fd1;
-                else if (FD_ISSET(f1, &eset)) retFd = fd1;
-                else if (FD_ISSET(f2, &rset)) retFd = fd2;
-                else if (FD_ISSET(f2, &wset)) retFd = fd2;
-                else if (FD_ISSET(f2, &eset)) retFd = fd2;
-                RETURN ( retFd );
-            }
-            RETURN ( nil );
-        }
-    }
-%}
-.
-    self primitiveFailed
+    ^ self selectOnAnyReadable:(Array with:fd1 with:fd2)
+                      writable:(Array with:fd1 with:fd2)
+                         error:nil
+                   withTimeOut:seconds
 !
 
 selectOnAnyReadable:fdArray withTimeOut:seconds
+    "wait for any fd in fdArray (an Array of integers) to become ready for reading;
+     timeout after t seconds. An empty set will always wait.
+     Return first ready fd if i/o ok, nil if timed-out or interrupted.
+     Experimental."
+
+    ^ self selectOnAnyReadable:fdArray 
+                      writable:nil 
+                         error:nil
+                   withTimeOut:seconds
+!
+
+selectOnAny:fdArray withTimeOut:seconds
     "wait for any fd in fdArray (an Array of integers) to become ready;
      timeout after t seconds. An empty set will always wait.
      Return first ready fd if i/o ok, nil if timed-out or interrupted.
      Experimental."
 
-    |millis count|
+    ^ self selectOnAnyReadable:fdArray
+                      writable:fdArray
+                         error:nil
+                   withTimeOut:seconds
+! 
+
+selectOnAnyReadable:readFdArray writable:writeFdArray error:errorFdArray withTimeOut:seconds
+    "wait for any fd in readFdArray (an Array of integers) to become ready for reading,
+     writeFdArray to become ready for writing.
+     timeout after t seconds. Empty sets will always wait.
+     Return first ready fd if i/o ok, nil if timed-out or interrupted.
+     Experimental."
+
+    |millis rcount wcount ecount|
 
     millis := (seconds * 1000) rounded asInteger.
-    (fdArray class == Array) ifFalse:[
+    (readFdArray isNil or:[readFdArray class == Array]) ifFalse:[
+        ^ self error:'argument must be an Array'
+    ].
+    (writeFdArray isNil or:[writeFdArray class == Array]) ifFalse:[
         ^ self error:'argument must be an Array'
     ].
-    count := fdArray size.
+    (errorFdArray isNil or:[errorFdArray class == Array]) ifFalse:[
+        ^ self error:'argument must be an Array'
+    ].
+    rcount := readFdArray size.
+    wcount := writeFdArray size.
+    ecount := errorFdArray size.
 %{
     fd_set rset, wset, eset;
     int t, f, maxF, i, lX, bX;
@@ -1001,14 +972,32 @@
         FD_ZERO(&eset);
 
         maxF = 0;
-        for (i=0; i<_intVal(count);i++) {
-            fd = _ArrayInstPtr(fdArray)->a_element[i];
+        for (i=0; i<_intVal(rcount);i++) {
+            fd = _ArrayInstPtr(readFdArray)->a_element[i];
             if (fd != nil) {
                 f = _intVal(fd);
                 if ((f >= 0) && (f < FD_SETSIZE)) {
                     FD_SET(f, &rset);
-/*                   FD_SET(f, &wset);       */
-/*                   FD_SET(f, &eset);       */
+                    if (f > maxF) maxF = f;
+                }
+            }
+        }
+        for (i=0; i<_intVal(wcount);i++) {
+            fd = _ArrayInstPtr(writeFdArray)->a_element[i];
+            if (fd != nil) {
+                f = _intVal(fd);
+                if ((f >= 0) && (f < FD_SETSIZE)) {
+                    FD_SET(f, &wset);       
+                    if (f > maxF) maxF = f;
+                }
+            }
+        }
+        for (i=0; i<_intVal(ecount);i++) {
+            fd = _ArrayInstPtr(errorFdArray)->a_element[i];
+            if (fd != nil) {
+                f = _intVal(fd);
+                if ((f >= 0) && (f < FD_SETSIZE)) {
+                    FD_SET(f, &eset);       
                     if (f > maxF) maxF = f;
                 }
             }
@@ -1019,8 +1008,8 @@
         if (select(maxF+1, &rset, &wset, &eset, &wt)) {
             for (i=0; i <= maxF; i++) {
                 if (FD_ISSET(i, &rset)
-/*                 || FD_ISSET(i, &wset)
-                   || FD_ISSET(i, &eset) */ ) {
+                 || FD_ISSET(i, &wset)
+                 || FD_ISSET(i, &eset)) {
                     RETURN ( _MKSMALLINT(i) );
                 }
             }
--- a/WriteStr.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/WriteStr.st	Wed Oct 13 01:19:00 1993 +0100
@@ -26,7 +26,7 @@
 streamed-upon collection if it cannot grow. Thus its slightly incompatible to ST-80 since
 aStream contents does not always return the original collection. This will change soon.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/Attic/WriteStr.st,v 1.3 1993-10-13 00:19:00 claus Exp $
 '!
 
 !WriteStream class methodsFor:'instance creation'!
--- a/WriteStream.st	Mon Oct 04 11:32:33 1993 +0100
+++ b/WriteStream.st	Wed Oct 13 01:19:00 1993 +0100
@@ -26,7 +26,7 @@
 streamed-upon collection if it cannot grow. Thus its slightly incompatible to ST-80 since
 aStream contents does not always return the original collection. This will change soon.
 
-%W% %E%
+$Header: /cvs/stx/stx/libbasic/WriteStream.st,v 1.3 1993-10-13 00:19:00 claus Exp $
 '!
 
 !WriteStream class methodsFor:'instance creation'!