--- a/Set.st Sat Feb 05 13:23:03 1994 +0100
+++ b/Set.st Sat Feb 05 13:24:58 1994 +0100
@@ -24,7 +24,7 @@
a Set is a collection where each element occurs at most once.
-$Header: /cvs/stx/stx/libbasic/Set.st,v 1.6 1994-01-09 21:24:05 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Set.st,v 1.7 1994-02-05 12:24:12 claus Exp $
written jun 91 by claus
jan 93 claus: changed to use hashing
jan 94 claus: recoded to mark empty slots instead of rehashing
@@ -341,7 +341,16 @@
|index next|
+"this is actually the same as:
+
index := self find:oldObject ifAbsent:[^ exceptionBlock value].
+
+ but cheaper, since there will be no new block to create
+ (remember: [0] blocks are super-cheap)
+"
+ index := self find:oldObject ifAbsent:[0].
+ index == 0 ifTrue:[^ exceptionBlock value].
+
keyArray basicAt:index put:nil.
tally := tally - 1.
tally == 0 ifTrue:[
@@ -365,9 +374,14 @@
do:aBlock
"perform the block for all members in the collection."
- keyArray do:[:each |
- (each notNil and:[each ~~ DeletedEntry]) ifTrue:[
- aBlock value:each
+ |sz "{ Class: SmallInteger }"
+ element|
+
+ sz := keyArray size.
+ 1 to:sz do:[:index |
+ element := keyArray at:index.
+ (element notNil and:[element ~~ DeletedEntry]) ifTrue:[
+ aBlock value:element
]
]
! !
--- a/SmallInt.st Sat Feb 05 13:23:03 1994 +0100
+++ b/SmallInt.st Sat Feb 05 13:24:58 1994 +0100
@@ -22,7 +22,7 @@
COPYRIGHT (c) 1988 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libbasic/Attic/SmallInt.st,v 1.8 1994-01-16 03:46:48 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/SmallInt.st,v 1.9 1994-02-05 12:24:25 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 !!)
@@ -98,6 +98,13 @@
"this class is known by the run-time-system"
^ true
+!
+
+canBeSubclassed
+ "return true, if its allowed to create subclasses of the receiver.
+ Return nil here - since it is NOT possible for UndefinedObject"
+
+ ^ false
! !
!SmallInteger methodsFor:'error catching'!
--- a/SmallInteger.st Sat Feb 05 13:23:03 1994 +0100
+++ b/SmallInteger.st Sat Feb 05 13:24:58 1994 +0100
@@ -22,7 +22,7 @@
COPYRIGHT (c) 1988 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.8 1994-01-16 03:46:48 claus Exp $
+$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.9 1994-02-05 12:24:25 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 !!)
@@ -98,6 +98,13 @@
"this class is known by the run-time-system"
^ true
+!
+
+canBeSubclassed
+ "return true, if its allowed to create subclasses of the receiver.
+ Return nil here - since it is NOT possible for UndefinedObject"
+
+ ^ false
! !
!SmallInteger methodsFor:'error catching'!
--- a/Smalltalk.st Sat Feb 05 13:23:03 1994 +0100
+++ b/Smalltalk.st Sat Feb 05 13:24:58 1994 +0100
@@ -32,7 +32,7 @@
- my implementation of globals is totally different
(due to the need to be able to access globals from c-code as well).
-$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.12 1994-01-16 03:47:00 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.13 1994-02-05 12:24:39 claus Exp $
'!
Smalltalk at:#ErrorNumber put:nil!
@@ -85,7 +85,7 @@
versionDate
"return the version date"
- ^ '19-jan-1993'
+ ^ '21-jan-1993'
"Smalltalk versionDate"
!
@@ -93,7 +93,7 @@
copyright
"return a copyright string"
- ^ 'Copyright (c) 1988-93 by Claus Gittinger'
+ ^ 'Copyright (c) 1988-94 by Claus Gittinger'
"Smalltalk copyright"
!
@@ -335,8 +335,10 @@
].
Initializing := false.
+
+ "do not expect to get things fixed by setting it to false ... :-)"
DemoMode ifTrue:[
- Transcript showCr:'Unlicensed demo mode with limitations.'
+ Transcript showCr:' *** Unlicensed demo mode with restrictions ***'
].
"let display install itself into Processors dispatch"
@@ -418,7 +420,7 @@
Transcript cr.
Transcript showCr:('Smalltalk restarted from:' , ImageName).
DemoMode ifTrue:[
- Transcript showCr:'Unlicensed demo mode with limitations.'
+ Transcript showCr:' *** Unlicensed demo mode with restrictions ***'
].
"
--- a/Stream.st Sat Feb 05 13:23:03 1994 +0100
+++ b/Stream.st Sat Feb 05 13:24:58 1994 +0100
@@ -22,7 +22,7 @@
COPYRIGHT (c) 1989 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libbasic/Stream.st,v 1.4 1993-10-13 02:14:01 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Stream.st,v 1.5 1994-02-05 12:24:58 claus Exp $
'!
!Stream class methodsFor:'instance creation'!
@@ -204,32 +204,33 @@
!Stream methodsFor: 'nonhomogeneous accessing'!
nextNumber: n
- "Answer the next n bytes as a positive Integer or LargePositiveInteger."
+ "Answer the next n bytes as a positive Integer."
| s i |
+
n <= 4 ifTrue:[
- s _ 0.
- i _ 0.
- [(i _ i + 1) <= n] whileTrue: [s _ ((s bitShift: 8) bitOr: self next)].
- ^s
+ s := 0.
+ i := 0.
+ [(i := i + 1) <= n] whileTrue: [s := ((s bitShift: 8) bitOr: self next)].
+ ^ s
].
- s _ 0.
+ s := 0.
1 to: n do: [:j | s := s * 256 + self next].
"reverse order of significance"
^s truncated
!
nextNumber: n put: v
- "Append to the receiver the argument, v, which is a positive SmallInteger or
- a LargePositiveInteger, as the next n bytes. Possibly pad with leading zeros."
-
+ "Append to the receiver the argument, v, which is a positive Integer,
+ as the next n bytes. Possibly pad with leading zeros."
| vlen i |
- n < (vlen _ v digitLength) ifTrue: [self error: 'number too big'].
+
+ n < (vlen := v digitLength) ifTrue: [self error: 'number too big'].
"pad with leading zeros"
- i _ n.
- [i > vlen] whileTrue: [self nextPut: 0. i _ i - 1].
+ i := n.
+ [i > vlen] whileTrue: [self nextPut: 0. i := i - 1].
i = 1 ifTrue: [^self nextPut: v].
- [i > 0] whileTrue: [self nextPut: (v digitAt: i). i _ i - 1]
+ [i > 0] whileTrue: [self nextPut: (v digitAt: i). i := i - 1]
! !