Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2(pesnta/xelos-%I%) 9/18/84; site pesnta.UUCP Path: utzoo!lsuc!per!pesnta!earlw From: earlw@pesnta.UUCP (Earl Wallace) Newsgroups: pe.cust.sources Subject: Small Littletalk - Part 3 of 5 Message-ID: <2760@pesnta.UUCP> Date: Wed, 12-Jun-85 00:34:15 EDT Article-I.D.: pesnta.2760 Posted: Wed Jun 12 00:34:15 1985 Date-Received: Sun, 16-Jun-85 23:05:25 EDT Organization: Perkin-Elmer Data Systems Group / Customer Service Lines: 6883 #! /bin/sh # # This is the Little Smalltalk program that Marc Ries of the P-E Tustin Office # acquired and passed on to me. It should work with Perkin-Elmer's Edition VII # and XELOS systems. # # -earlw@pesnta # #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # prelude # This archive created: Tue Jun 11 19:06:06 1985 # By: Earl Wallace (Perkin-Elmer Data Systems Group / Customer Service) export PATH; PATH=/bin:$PATH if test ! -d 'prelude' then mkdir 'prelude' fi cd 'prelude' if test -f 'Makefile' then echo shar: will not over-write existing file "'Makefile'" else cat << \SHAR_EOF > 'Makefile' .SUFFIXES : .st .p PREPATH = /usr/src/public/lsmalltalk/prelude BINDIR = ../bin PARSED = class.p object.p \ string.p larray.p nil.p array.p\ boolean.p true.p false.p block.p symbol.p \ magnitude.p number.p integer.p char.p float.p radian.p point.p random.p \ collection.p bag.p set.p kcollection.p dictionary.p scollection.p interval.p \ list.p acollection.p file.p bytearray.p \ semaphore.p process.p smalltalk.p .st.p: $(BINDIR)/parse $(PREPATH)/$*.st >$*.p install: standard -make fastsave bundle: *.st Makefile savescript bundle Makefile savescript init *.st >../prelude.bundle standard: $(PARSED) cat $(PARSED) init >standard newstd: $(PARSED) cat $(PARSED) >newstd fastsave: standard $(BINDIR)/st -m 'savescript' )s stdsave SHAR_EOF if test 11 -ne "`wc -c < 'savescript'`" then echo shar: error transmitting "'savescript'" '(should have been 11 characters)' fi fi # end of overwriting check if test -f 'init' then echo shar: will not over-write existing file "'init'" else cat << \SHAR_EOF > 'init' smalltalk new SHAR_EOF if test 14 -ne "`wc -c < 'init'`" then echo shar: error transmitting "'init'" '(should have been 14 characters)' fi fi # end of overwriting check if test -f 'acollection.st' then echo shar: will not over-write existing file "'acollection.st'" else cat << \SHAR_EOF > 'acollection.st' Class ArrayedCollection :SequenceableCollection | current | [ = anArray | i | (self size ~= anArray size) ifTrue: [^ false]. i <- 0. self do: [:x | (x ~= (anArray at: (i <- i + 1))) ifTrue: [^ false]]. ^ true | at: key ifAbsent: exceptionBlock ((key <= 0) or: [key > self size]) ifTrue: [^ exceptionBlock value]. ^ self at: key | coerce: aCollection | temp | temp <- self class new: aCollection size. temp replaceFrom: 1 to: aCollection size with: aCollection. ^ temp | copyFrom: start to: stop | size temp | size <- stop - start + 1. temp <- self class new: size. temp replaceFrom: 1 to: size with: self startingAt: start. ^ temp | currentKey ^ current | deepCopy | newobj | newobj <- self class new: self size. (1 to: self size) do: [:i | newobj at: i put: (self at: i) copy ]. ^ newobj | do: aBlock (1 to: self size) do: [:i | current <- i. aBlock value: (self at: i)] | first current <- 1. ^ (current <= self size) ifTrue: [ self at: current] | firstKey ^ 1 | lastKey ^ self size | next current <- current + 1. ^ (current <= self size) ifTrue: [ self at: current] | shallowCopy | newobj | newobj <- self class new: self size. (1 to: self size) do: [:i | newobj at: i put: (self at: i) ]. ^ newobj ] SHAR_EOF if test 1564 -ne "`wc -c < 'acollection.st'`" then echo shar: error transmitting "'acollection.st'" '(should have been 1564 characters)' fi fi # end of overwriting check if test -f 'array.st' then echo shar: will not over-write existing file "'array.st'" else cat << \SHAR_EOF > 'array.st' Class Array :ArrayedCollection [ new: aValue ^ | at: aNumber ( (aNumber < 1) or: [aNumber > ] ) ifTrue: [ self error: 'index error'. ^nil ]. ^ | at: aNumber put: aValue ( (aNumber < 1) or: [aNumber > ] ) ifTrue: [ self error: 'index error'. ^nil ]. . ^ aValue | printString | value i | value <- ')'. i <- . [i > 0] whileTrue: [ value <- printString , ' ', value. i <- i - 1]. ^ '#( ' , value | size ^ ] SHAR_EOF if test 642 -ne "`wc -c < 'array.st'`" then echo shar: error transmitting "'array.st'" '(should have been 642 characters)' fi fi # end of overwriting check if test -f 'bag.st' then echo shar: will not over-write existing file "'bag.st'" else cat << \SHAR_EOF > 'bag.st' Class Bag :Collection | dict count | [ new dict <- Dictionary new | add: newElement dict at: newElement put: (1 + (dict at: newElement ifAbsent: [0])) | add: newObj withOccurrences: anInteger anInteger timesRepeat: [ self add: newObj ]. ^ newObj | remove: oldElement ifAbsent: exceptionBlock | i | i <- dict at: oldElement ifAbsent: [ ^ exceptionBlock value]. (1 = i) ifTrue: [dict removeKey: oldElement] ifFalse: [dict at: oldElement put: i - 1 ] | size ^ dict inject: 0 into: [:x :y | x + y] | occurrencesOf: anElement ^ dict at: anElement ifAbsent: [0] | first (count <- dict first) isNil ifTrue: [^ nil]. count <- count - 1. ^ dict currentKey | next [count notNil] whileTrue: [ (count > 0) ifTrue: [count <- count - 1. ^ dict currentKey] ifFalse: [(count <- dict next) isNil ifTrue: [^ nil] ]]. ^ nil ] SHAR_EOF if test 1102 -ne "`wc -c < 'bag.st'`" then echo shar: error transmitting "'bag.st'" '(should have been 1102 characters)' fi fi # end of overwriting check if test -f 'block.st' then echo shar: will not over-write existing file "'block.st'" else cat << \SHAR_EOF > 'block.st' " Class Block. Note how whileTrue: and whileFalse: depend upon the parser optimizing the loops into control flow, rather than message passing. If this were not the case, whileTrue: would have to be implemented using recursion, as follows: whileTrue: aBlock (self value) ifFalse: [^nil]. aBlock value. ^ self whileTrue: aBlock " Class Block [ newProcess ^ | newProcessWith: argumentArray ^ | fork self newProcess resume. ^ nil | forkWith: argumentArray (self newProcessWith: argumentArray) resume. ^ nil | whileTrue ^ [self value ] whileTrue: [] | whileTrue: aBlock ^ [ self value ] whileTrue: [ aBlock value ] | whileFalse ^ [ self value ] whileFalse: [] | whileFalse: aBlock ^ [ self value ] whileFalse: [ aBlock value ] | value | value: a | value: a value: b | value: a value: b value: c | value: a value: b value: c value: d | value: a value: b value: c value: d value: e ] SHAR_EOF if test 1111 -ne "`wc -c < 'block.st'`" then echo shar: error transmitting "'block.st'" '(should have been 1111 characters)' fi fi # end of overwriting check if test -f 'boolean.st' then echo shar: will not over-write existing file "'boolean.st'" else cat << \SHAR_EOF > 'boolean.st' Class Boolean [ & aBoolean ^ self and: [aBoolean] | | aBoolean ^ self or: [aBoolean] | and: aBlock ^ self and: [aBlock value] | or: aBlock ^ self or: [aBlock value] | eqv: aBoolean ^ self == aBoolean | xor: aBoolean ^ self ~~ aBoolean ] SHAR_EOF if test 297 -ne "`wc -c < 'boolean.st'`" then echo shar: error transmitting "'boolean.st'" '(should have been 297 characters)' fi fi # end of overwriting check if test -f 'bytearray.st' then echo shar: will not over-write existing file "'bytearray.st'" else cat << \SHAR_EOF > 'bytearray.st' Class ByteArray :ArrayedCollection [ new: size ^ | at: index ^ | at: index put: value | printString | str | str <- '#[ '. (1 to: self size) do: [:i | str <- str , (self at: i) printString , ' ']. ^ str , ']' | size ^ ] SHAR_EOF if test 344 -ne "`wc -c < 'bytearray.st'`" then echo shar: error transmitting "'bytearray.st'" '(should have been 344 characters)' fi fi # end of overwriting check if test -f 'char.st' then echo shar: will not over-write existing file "'char.st'" else cat << \SHAR_EOF > 'char.st' Class Char :Magnitude [ == aChar ^ ifTrue: [] ifFalse: [false] | < aChar ^ ifTrue: [] ifFalse: [self compareError] | = aChar ^ ifTrue: [] ifFalse: [self compareError] | > aChar ^ ifTrue: [] ifFalse: [self compareError] | asciiValue ^ | asLowercase ^ ifTrue: [] ifFalse: [self] | asUppercase ^ ifTrue: [] ifFalse: [self] | asString ^ | compareError ^ self error: 'char cannot be compared to non char' | digitValue | i | ((i <- ) isNil) ifTrue: [self error: 'digitValue on nondigit char']. ^ i | isAlphaNumeric ^ | isDigit ^ self between: $0 and: $9 | isLetter ^ self isLowercase or: [self isUppercase] | isLowercase ^ self between: $a and: $z | isSeparator ^ | isUppercase ^ (self between: $A and: $Z) | isVowel ^ | printString ^ '$' , ] SHAR_EOF if test 1255 -ne "`wc -c < 'char.st'`" then echo shar: error transmitting "'char.st'" '(should have been 1255 characters)' fi fi # end of overwriting check if test -f 'class.st' then echo shar: will not over-write existing file "'class.st'" else cat << \SHAR_EOF > 'class.st' Class Class [ edit | list | new | superclass newinstance | superclass <- . ifTrue: [newinstance <- superclass new ]. newinstance <- . ifTrue: [newinstance <- newinstance new]. ^ newinstance | new: aValue | superclass newinstance | superclass <- . ifTrue: [newinstance <- superclass new ]. newinstance <- . ifTrue: [newinstance <- newinstance new: aValue ]. ^ newinstance | printString ^ | respondsTo | respondsTo: aSymbol | aClass | aClass <- self. [aClass notNil] whileTrue: [ ifTrue: [ ^ true ]. aClass <- aClass superClass ]. ^ false | superClass ^ | variables ^ | view ] SHAR_EOF if test 1048 -ne "`wc -c < 'class.st'`" then echo shar: error transmitting "'class.st'" '(should have been 1048 characters)' fi fi # end of overwriting check if test -f 'collection.st' then echo shar: will not over-write existing file "'collection.st'" else cat << \SHAR_EOF > 'collection.st' Class Collection [ addAll: aCollection aCollection do: [:x | self add: x ] | asArray ^ Array new: self size ; replaceFrom: 1 to: self size with: self | asBag ^ Bag new addAll: self | asSet ^ Set new addAll: self | asList ^ List new addAllLast: self | asString ^ String new: self size ; replaceFrom: 1 to: self size with: self | coerce: aCollection | newobj | newobj <- self new. aCollection do: [:x | newobj add: x]. ^ newobj | collect: aBlock ^ self inject: self class new into: [:x :y | x add: (aBlock value: y). x ] | deepCopy | newobj | newobj <- List new . self do: [:x | newobj addLast: x copy ]. ^ self coerce: newobj | detect: aBlock ^ self detect: aBlock ifAbsent: [self error: 'no object found matching detect'] | detect: aBlock ifAbsent: exceptionBlock self do: [:x | (aBlock value: x) ifTrue: [^ x]]. ^ exceptionBlock value | first ^ self error: 'subclass should implement first' | includes: anObject self do: [:x | (x = anObject) ifTrue: [^ true]]. ^ false | inject: thisValue into: binaryBlock | last | last <- thisValue. self do: [:x | last <- binaryBlock value: last value: x]. ^ last | isEmpty ^ (self size = 0) | occurrencesOf: anObject ^ self inject: 0 into: [:x :y | (y = anObject) ifTrue: [x + 1] ifFalse: [x] ] | printString ^ ( self inject: self class printString , ' (' into: [:x :y | x , ' ' , y printString]), ' )' | reject: aBlock ^ self select: [:x | (aBlock value: x) not ] | remove: oldObject self remove: oldObject ifAbsent: [^ self error: 'attempt to remove object not found in collection' ]. ^ oldObject | remove: oldObject ifAbsent: exceptionBlock ^ (self includes: oldObject) ifTrue: [self remove: oldObject] ifFalse: exceptionBlock | select: aBlock ^ self inject: self class new into: [:x :y | (aBlock value: y) ifTrue: [x add: y]. x] | shallowCopy | newobj | newobj <- List new . self do: [:x | newobj addLast: x]. ^ self coerce: newobj | size | i | i <- 0. self do: [:x | i <- i + 1 ]. ^ i ] SHAR_EOF if test 2501 -ne "`wc -c < 'collection.st'`" then echo shar: error transmitting "'collection.st'" '(should have been 2501 characters)' fi fi # end of overwriting check if test -f 'dictionary.st' then echo shar: will not over-write existing file "'dictionary.st'" else cat << \SHAR_EOF > 'dictionary.st' " Dictionarys are implemented using Points in order to reduce the number of classes in the standard prelude this also has the advantage of making the output appear in key @ value form " Class Dictionary :KeyedCollection | hashTable currentBucket currentList | [ new hashTable <- Array new: 17 | hashNumber: aKey ^ ( \\ hashTable size) + 1 | getList: aKey | list bucketNumber | bucketNumber <- self hashNumber: aKey. list <- hashTable at: bucketNumber. (list isNil) ifTrue: [list <- List new. hashTable at: bucketNumber put: list]. ^ list | at: aKey put: anObject | list anAssoc | list <- self getList: aKey. anAssoc <- self findAssociation: aKey inList: list. (anAssoc isNil) ifTrue: [anAssoc <- (Point new x: aKey) y: anObject. list add: anAssoc] ifFalse: [anAssoc y: anObject]. ^ anObject | at: aKey ifAbsent: exceptionBlock | list anAssoc | list <- self getList: aKey. anAssoc <- self findAssociation: aKey inList: list. (anAssoc isNil) ifTrue: [^ exceptionBlock value]. ^ anAssoc y | removeKey: aKey ifAbsent: exceptionBlock | list anAssoc| list <- self getList: aKey. anAssoc <- self findAssociation: aKey inList: list. (anAssoc isNil) ifTrue: [^ exceptionBlock value]. ^ ( list remove: anAssoc ifAbsent: [ ^ exceptionBlock value ] ) y | findAssociation: aKey inList: linkedList linkedList do: [:item | (item x = aKey) ifTrue: [^ item]]. ^ nil | first | item | (1 to: 17) do: [:i | ((item <- self checkBucket: i) notNil) ifTrue: [ ^ item y] ] . ^ nil | next | item | ((item <- currentList next) notNil) ifTrue: [ ^ item y ]. [currentBucket < 17] whileTrue: [currentBucket <- currentBucket + 1. ((item <- self checkBucket: currentBucket) notNil) ifTrue: [ ^ item y ] ]. ^ nil | printString ^ (self inject: (self class printString) , ' ( ' into: [ :aString :aValue | aString , self currentKey printString , ' @ ' , aValue printString , ' ' ] ) , ')' | currentKey | clist| ^ (currentList notNil) ifTrue: [clist <- currentList current. (clist notNil) ifTrue: [clist x] ] | checkBucket: bucketNumber ((currentList <- hashTable at: (currentBucket <- bucketNumber)) isNil) ifTrue: [ ^ nil ]. ^ currentList first ] SHAR_EOF if test 2333 -ne "`wc -c < 'dictionary.st'`" then echo shar: error transmitting "'dictionary.st'" '(should have been 2333 characters)' fi fi # end of overwriting check if test -f 'false.st' then echo shar: will not over-write existing file "'false.st'" else cat << \SHAR_EOF > 'false.st' Class False :Boolean [ ifTrue: trueAlternativeBlock ifFalse: falseAlternativeBlock ^ falseAlternativeBlock value ! ifFalse: falseAlternativeBlock ifTrue: trueAlternativeBlock ^ falseAlternativeBlock value ! ifTrue: trueAlternativeBlock ^ nil ! ifFalse: falseAlternativeBlock ^ falseAlternativeBlock value ! not ^ true ] SHAR_EOF if test 436 -ne "`wc -c < 'false.st'`" then echo shar: error transmitting "'false.st'" '(should have been 436 characters)' fi fi # end of overwriting check if test -f 'file.st' then echo shar: will not over-write existing file "'file.st'" else cat << \SHAR_EOF > 'file.st' Class File :SequenceableCollection [ modeCharacter | modeInteger | modeString | at: aPosition . ^ self read | at: aPosition put: anObject . ^ self write: anObject | currentKey ^ | first ^ self at: 0 | next ^ self read | open: aName | open: aName for: opType | read ^ | size ^ | write: anObject ^ ] SHAR_EOF if test 630 -ne "`wc -c < 'file.st'`" then echo shar: error transmitting "'file.st'" '(should have been 630 characters)' fi fi # end of overwriting check if test -f 'float.st' then echo shar: will not over-write existing file "'float.st'" else cat << \SHAR_EOF > 'float.st' Class Float :Number [ = aNumber ^ ifTrue: [] ifFalse: [super = aNumber] | < aNumber ^ ifTrue: [] ifFalse: [super < aNumber] | > aNumber ^ ifTrue: [] ifFalse: [ super > aNumber] | + aNumber ^ ifTrue: [] ifFalse: [super + aNumber] | - aNumber ^ ifTrue: [] ifFalse: [super - aNumber] | * aNumber ^ ifTrue: [] ifFalse: [super * aNumber] | / aNumber ^ ifTrue: [] ifFalse: [super / aNumber] | ^ aNumber ^ ifTrue: [] ifFalse: [super raisedTo: aNumber] | arcCos ^ Radian new: | arcSin ^ Radian new: | arcTan ^ Radian new: | asFloat ^ self | asString ^ | ceiling ^ | coerce: aNumber ^ aNumber asFloat | exp ^ | floor ^ | fractionPart ^ | gamma ^ | integerPart ^ | ln ^ | radix: aNumber ^ | rounded ^ | sqrt ^ | truncated ^ (self < 0.0) ifTrue: [] ifFalse: [] ] SHAR_EOF if test 1655 -ne "`wc -c < 'float.st'`" then echo shar: error transmitting "'float.st'" '(should have been 1655 characters)' fi fi # end of overwriting check if test -f 'integer.st' then echo shar: will not over-write existing file "'integer.st'" else cat << \SHAR_EOF > 'integer.st' Class Integer :Number [ = aNumber ^ ifTrue: [ ] ifFalse: [ super = aNumber ] | > aNumber ^ ifTrue: [ ] ifFalse: [ super > aNumber ] | < aNumber ^ ifTrue: [ ] ifFalse: [ super < aNumber ] | + aNumber ^ ifTrue: [ ] ifFalse: [ super + aNumber ] | - aNumber ^ ifTrue: [] ifFalse: [ super - aNumber ] | * aNumber ^ ifTrue: [] ifFalse: [ super * aNumber ] | / aNumber ^ self asFloat / aNumber | // aNumber ^ ifTrue: [] ifFalse: [self opError] | \\ aNumber | i | ^ ifTrue: [i <- self * ( (self < 0) ifTrue: [ -1 ] ifFalse: [ 1 ] ). i rem: aNumber] ifFalse: [self opError] | allMask: anInteger ^ anInteger = | anyMask: anInteger ^ 0 ~= | asCharacter ^ | asFloat ^ | asString ^ | bitAnd: anInteger ^ | bitAt: anInteger ^ | bitInvert ^ | bitOr: anInteger ^ | bitShift: anInteger ^ | bitXor: anInteger ^ | even ^ (self rem: 2) = 0 | factorial ^ | gcd: anInteger ^ ifTrue: [] ifFalse: [self opError] | highBit ^ | lcm: anInteger ^ ifTrue: [self * anInteger quo: (self gcd: anInteger)] ifFalse: [self opError] | noMask: anInteger ^ 0 = (self bitAnd: anInteger) | odd ^ (self rem: 2) ~= 0 | quo: anInteger ^ ifTrue: [] ifFalse: [self opError] | radix: aNumber ^ | rem: anInteger ^ ifTrue: [] ifFalse: [self opError] | timesRepeat: aBlock | i | i <- 0. [i < self] whileTrue: [aBlock value. i <- i + 1] ] SHAR_EOF if test 2472 -ne "`wc -c < 'integer.st'`" then echo shar: error transmitting "'integer.st'" '(should have been 2472 characters)' fi fi # end of overwriting check if test -f 'interval.st' then echo shar: will not over-write existing file "'interval.st'" else cat << \SHAR_EOF > 'interval.st' Class Interval :SequenceableCollection | lower upper step current | [ from: lowerBound to: upperBound by: stepSize current <- lower <- lowerBound. upper <- upperBound. step <- stepSize | size ^ ((step strictlyPositive) ifTrue: [upper < lower] ifFalse: [lower < upper] ) ifTrue: [ 0 ] ifFalse: [upper - lower // step + 1] | inRange: value ^ (step strictlyPositive) ifTrue: [(value >= lower) and: [value <= upper]] ifFalse: [(value >= upper) and: [value <= lower]] | first current <- lower. ^ (self inRange: current) ifTrue: [current] | next current <- current + step. ^ (self inRange: current) ifTrue: [current] | at: index ifAbsent: exceptionBlock | val | val <- lower + (step * (index - 1)). ^ (self inRange: val) ifTrue: [ val ] ifFalse: [exceptionBlock value] | printString ^ 'Interval ', lower printString , ' to ', upper printString , ' by ' , step printString | coerce: newcollection ^ newcollection asArray | at: index put: val ^ self error: 'cannot store into Interval' | add: val ^ self error: 'cannot store into Interval' | removeKey: key ifAbsent: exceptionBlock self error: 'cannot remove from Interval'. ^ exceptionBlock value | deepCopy ^ lower to: upper by: step | shallowCopy ^ lower to: upper by: step ] SHAR_EOF if test 1369 -ne "`wc -c < 'interval.st'`" then echo shar: error transmitting "'interval.st'" '(should have been 1369 characters)' fi fi # end of overwriting check if test -f 'kcollection.st' then echo shar: will not over-write existing file "'kcollection.st'" else cat << \SHAR_EOF > 'kcollection.st' Class KeyedCollection :Collection [ add: anElement ^ self error: 'Must add with explicit key' | addAll: aCollection aCollection binaryDo: [:x :y | self at: x put: y]. ^ aCollection | asDictionary | newCollection | newCollection <- Dictionary new. self binaryDo: [:key :val | newCollection at: key put: val]. ^ newCollection | at: key ^ self at: key ifAbsent: [self error: (key printString , ': association not found'). ^ key] | atAll: aCollection put: anObject aCollection do: [:x | self at: x put: anObject] | binaryDo: aBlock | item | self do: [:x | aBlock value: self currentKey value: x ]. ^ nil | collect: aBlock ^ self coerce: (self inject: Dictionary new into: [:x :y | x at: self currentKey put: (aBlock value: y) . x ] ) | includesKey: key self at: key ifAbsent: [^ false]. ^ true | indexOf: anElement ^ self indexOf: anElement ifAbsent: [self error: 'indexOf element not found'] | indexOf: anElement ifAbsent: exceptionBlock self do: [:x | (x = anElement) ifTrue: [ ^ self currentKey ]]. ^ exceptionBlock value | keys | newset | newset <- Set new. self keysDo: [:x | newset add: x]. ^ newset | keysDo: aBlock ^ self do: [ :x | aBlock value: self currentKey ] | keysSelect: aBlock ^ self coerce: (self inject: Dictionary new into: [:x :y | (aBlock value: y currentKey) ifTrue: [x at: self currentKey put: y]. x ] ) | remove: anElement ^ self error: 'object must be removed with explicit key' | removeKey: key ^ self removeKey: key ifAbsent: [self error: 'no element associated with key'. ^ key] | removeKey: key ifAbsent: exceptionBlock ^ self error: 'subclass should implement RemoveKey:ifAbsent:' | select: aBlock ^ self coerce: (self inject: Dictionary new into: [:x :y | (aBlock value: y) ifTrue: [x at: self currentKey put: y]. x ] ) | values | newbag | newbag <- Bag new. self do: [:x | newbag add: x]. ^ newbag ] SHAR_EOF if test 2628 -ne "`wc -c < 'kcollection.st'`" then echo shar: error transmitting "'kcollection.st'" '(should have been 2628 characters)' fi fi # end of overwriting check if test -f 'larray.st' then echo shar: will not over-write existing file "'larray.st'" else cat << \SHAR_EOF > 'larray.st' Class ArrayedCollection " This is just a null version of ArrayedCollection to serve as a place holder until the real version is read in during the prelude " [ nothing 1 ] SHAR_EOF if test 175 -ne "`wc -c < 'larray.st'`" then echo shar: error transmitting "'larray.st'" '(should have been 175 characters)' fi fi # end of overwriting check if test -f 'list.st' then echo shar: will not over-write existing file "'list.st'" else cat << \SHAR_EOF > 'list.st' " Lists are implemented using Points in order to reduce the number of classes in the standard prelude " Class List :SequenceableCollection | first current | [ add: anItem first <- (Point new x: anItem ) y: first . ^ anItem | addFirst: anItem first <- (Point new x: anItem ) y: first . ^ anItem | addLast: anItem (first isNil) ifTrue: [^ self addFirst: anItem]. (self findLast) y: ((Point new x: anItem) y: nil). ^ anItem | addAllFirst: aCollection aCollection do: [:x | self addFirst: x] | addAllLast: aCollection aCollection do: [:x | self addLast: x] | coerce: aCollection | newList | newList <- List new. aCollection do: [:x | newList addLast: x]. ^ newList | findLast | item | ((item <- first) isNil) ifTrue: [^ nil]. [(item y) notNil] whileTrue: [item <- item y]. ^ item | remove: anItem ^ self remove: anItem ifAbsent: [self error: 'cant find item'] | remove: anItem ifAbsent: exceptionBlock (first isNil) ifTrue: [^ exceptionBlock value]. self inject: nil into: [:prev :current | (current x == anItem) ifTrue: [(prev isNil) ifTrue: [first <- current y] ifFalse: [prev y: (current y)]. ^ anItem]. current ] . ^ exceptionBlock value | removeError ^ self error: 'cannot remove from an empty list' | removeFirst | item | (first isNil) ifTrue: [^ self removeError]. item <- first. first <- first y. ^ item x | removeLast (first isNil) ifTrue: [^ self removeError]. ^ self remove: self last ifAbsent: [self removeError] | first ^ ((current <- first) notNil) ifTrue: [ current x ] | next ^ ((current <- current y) notNil) ifTrue: [ current x ] | current ^ current x | last (first isNil) ifTrue: [^ nil]. ^ self findLast x | isEmpty ^ first == nil ] SHAR_EOF if test 1802 -ne "`wc -c < 'list.st'`" then echo shar: error transmitting "'list.st'" '(should have been 1802 characters)' fi fi # end of overwriting check if test -f 'magnitude.st' then echo shar: will not over-write existing file "'magnitude.st'" else cat << \SHAR_EOF > 'magnitude.st' Class Magnitude [ <= arg ^ (self < arg) or: [self = arg] | < arg ^ (arg > self) | = arg ^ (self > arg or: [self < arg]) not | ~= arg ^ (self = arg) not | >= arg ^ (self > arg) or: [self = arg] | > arg ^ arg < self | between: low and: high ^ (self >= low) and: [self <= high] | min: arg ^ (self < arg) ifTrue: [self] ifFalse: [arg] | max: arg ^ (self > arg) ifTrue: [self] ifFalse: [arg] ] SHAR_EOF if test 416 -ne "`wc -c < 'magnitude.st'`" then echo shar: error transmitting "'magnitude.st'" '(should have been 416 characters)' fi fi # end of overwriting check if test -f 'nil.st' then echo shar: will not over-write existing file "'nil.st'" else cat << \SHAR_EOF > 'nil.st' Class UndefinedObject [ isNil ^ true | notNil ^ false | printString ^ 'nil' ] SHAR_EOF if test 150 -ne "`wc -c < 'nil.st'`" then echo shar: error transmitting "'nil.st'" '(should have been 150 characters)' fi fi # end of overwriting check if test -f 'number.st' then echo shar: will not over-write existing file "'number.st'" else cat << \SHAR_EOF > 'number.st' Class Number :Magnitude [ maxtype: aNumber ^ ifTrue: [self] ifFalse: [aNumber coerce: self ] | = aNumber ^ (self maxtype: aNumber) = (aNumber maxtype: self) | < aNumber ^ (self maxtype: aNumber) < (aNumber maxtype: self) | > aNumber ^ (self maxtype: aNumber) > (aNumber maxtype: self) | + aNumber ^ (self maxtype: aNumber) + (aNumber maxtype: self) | - aNumber ^ (self maxtype: aNumber) - (aNumber maxtype: self) | * aNumber ^ (self maxtype: aNumber) * (aNumber maxtype: self) | / aNumber ^ (self maxtype: aNumber) / (aNumber maxtype: self) | ^ aNumber ^ self asFloat ^ aNumber asFloat | @ aNumber ^ ( Point new x: self ) y: aNumber | abs ^ (self < 0) ifTrue: [ 0 - self ] ifFalse: [ self ] | exp ^ self asFloat exp | gamma ^ self asFloat gamma | ln ^ self asFloat ln | log: aNumber ^ self ln / aNumber ln | negated ^ 0 - self | negative ^ self < 0 | pi ^ self * 3.1415926 | positive ^ self >= 0 | radians ^ Radian new: self asFloat | raisedTo: aNumber ^ self asFloat ^ aNumber asFloat | reciprocal ^ 1.00 / self | roundTo: aNumber ^ (self / aNumber) rounded * aNumber | sign ^ (self < 0) ifTrue: [ -1 ] ifFalse: [ (self > 0) ifTrue: [ 1 ] ifFalse: [ 0 ] ] | sqrt ^ self asFloat sqrt | squared ^ self * self | strictlyPositive ^ self > 0 | to: highValue ^ Interval new ; from: self to: highValue by: 1 | to: highValue by: stepSize ^ Interval new ; from: self to: highValue by: stepSize | truncateTo: aNumber ^ (self / aNumber) truncated * aNumber ] SHAR_EOF if test 1597 -ne "`wc -c < 'number.st'`" then echo shar: error transmitting "'number.st'" '(should have been 1597 characters)' fi fi # end of overwriting check if test -f 'object.st' then echo shar: will not over-write existing file "'object.st'" else cat << \SHAR_EOF > 'object.st' Class Object [ == anObject ^ | ~~ x ^ (self == x) not | = x ^ (self == x) | ~= x ^ (self = x) not | asString ^ self class printString | asSymbol ^ self asString asSymbol | class ^ | copy ^ self shallowCopy | deepCopy | size newobj | size <- . (size < 0) ifTrue: [^ self] "if special just copy object" ifFalse: [ newobj <- self class new. (1 to: size) do: [:i | copy ) > ]. ^ newobj ] | do: aBlock | item | item <- self first. ^ [item notNil] whileTrue: [aBlock value: item. item <- self next] | error: aString | first ^ self | isKindOf: aClass | objectClass | objectClass <- self class. [objectClass notNil] whileTrue: [(objectClass == aClass) ifTrue: [^ true]. objectClass <- objectClass superClass]. ^ false | isMemberOf: aClass ^ aClass == self class | isNil ^ false | next ^ nil | notNil ^ true | print | printString ^ self asString | respondsTo: cmd ^ self class respondsTo: cmd | shallowCopy | size newobj | size <- . (size < 0) ifTrue: [^ self] "if special just copy object" ifFalse: [ newobj <- self class new. (1 to: size) do: [:i | > ]. ^ newobj ] ] SHAR_EOF if test 1760 -ne "`wc -c < 'object.st'`" then echo shar: error transmitting "'object.st'" '(should have been 1760 characters)' fi fi # end of overwriting check if test -f 'point.st' then echo shar: will not over-write existing file "'point.st'" else cat << \SHAR_EOF > 'point.st' Class Point :Magnitude | xvalue yvalue | [ < aPoint ^ (xvalue < aPoint x) and: [yvalue < aPoint y] | <= aPoint ^ (xvalue <= aPoint x) and: [yvalue < aPoint y] | >= aPoint ^ (xvalue >= aPoint x) and: [yvalue >= aPoint y] | = aPoint ^ (xvalue = aPoint x) and: [yvalue = aPoint y] | * scale ^ (Point new x: (xvalue * scale)) y: (yvalue * scale) | + delta ^ (Point new x: (xvalue + delta x)) y: (yvalue + delta y) | - delta ^ (Point new x: (xvalue - delta x)) y: (yvalue - delta y) | / scale ^ (Point new x: (xvalue / scale)) y: (yvalue / scale) | // scale ^ (Point new x: (xvalue // scale)) y: (yvalue // scale) | abs ^ (Point new x: xvalue abs) y: (yvalue abs) | asString ^ xvalue asString , ' @ ' , (yvalue asString) | dist: aPoint ^ ((xvalue - aPoint x) squared + (yvalue - aPoint y) squared) sqrt | max: aPoint ^ (Point new x: (xvalue max: aPoint x)) y: (yvalue max: aPoint y) | min: aPoint ^ (Point new x: (xvalue min: aPoint x)) y: (yvalue min: aPoint y) | printString ^ xvalue printString , ' @ ' , (yvalue printString) | transpose ^ (Point new x: yvalue) y: xvalue | x ^ xvalue | x: aValue xvalue <- aValue | x: xValue y: yValue xvalue <- xValue. yvalue <- yValue | y ^ yvalue | y: aValue yvalue <- aValue ] SHAR_EOF if test 1288 -ne "`wc -c < 'point.st'`" then echo shar: error transmitting "'point.st'" '(should have been 1288 characters)' fi fi # end of overwriting check if test -f 'process.st' then echo shar: will not over-write existing file "'process.st'" else cat << \SHAR_EOF > 'process.st' Class Process [ block (self state == #TERMINATED) ifTrue: [self termErr: 'block'. ^ nil]. . ^ self state | resume (self state == #TERMINATED) ifTrue: [self termErr: 'resume'. ^ nil]. . ^ self state | suspend (self state == #TERMINATED) ifTrue: [self termErr: 'suspend'. ^ nil]. . ^ self state | state | pstate | pstate <- . (pstate = 0) ifTrue: [pstate <- #READY. ^ pstate]. (pstate = 1) ifTrue: [pstate <- #SUSPENDED. ^ pstate]. (pstate = 2) ifTrue: [pstate <- #BLOCKED. ^ pstate]. (pstate = 3) ifTrue: [pstate <- #BLOCKED. ^ pstate]. (pstate >= 4) ifTrue: [pstate <- #TERMINATED. ^ pstate] | terminate . ^ self state | termErr: msgName ('Cannot ',msgName,' a terminated process.') print | unblock (self state == #TERMINATED) ifTrue: [self termErr: 'unblock'. ^ nil]. . ^ self state | yield ^ nil ] SHAR_EOF if test 1003 -ne "`wc -c < 'process.st'`" then echo shar: error transmitting "'process.st'" '(should have been 1003 characters)' fi fi # end of overwriting check if test -f 'radian.st' then echo shar: will not over-write existing file "'radian.st'" else cat << \SHAR_EOF > 'radian.st' Class Radian :Magnitude | value | [ new: x value <- | < arg ^ value < arg asFloat | = arg ^ value = arg asFloat | sin ^ | cos ^ | tan ^ / | asFloat ^ value | printString ^ value asString , ' radians' ] SHAR_EOF if test 459 -ne "`wc -c < 'radian.st'`" then echo shar: error transmitting "'radian.st'" '(should have been 459 characters)' fi fi # end of overwriting check if test -f 'random.st' then echo shar: will not over-write existing file "'random.st'" else cat << \SHAR_EOF > 'random.st' Class Random | seed | [ new seed <- 1 | randomize seed <- | first ^ ) > | next ^ ) > | between: low and: high ^ (self next * (high - low)) + low | randInteger: limit ^ (self next * limit) truncated + 1 | next: n | newa | newa <- Array new: n. (1 to: n) do: [:x | newa at: x put: self next]. ^ newa ] SHAR_EOF if test 494 -ne "`wc -c < 'random.st'`" then echo shar: error transmitting "'random.st'" '(should have been 494 characters)' fi fi # end of overwriting check if test -f 'scollection.st' then echo shar: will not over-write existing file "'scollection.st'" else cat << \SHAR_EOF > 'scollection.st' Class SequenceableCollection :KeyedCollection [ , aCollection ^ self coerce: (List new ; addAllLast: self ; addAllLast: aCollection ) | collect: aBlock ^ self coerce: (self inject: List new into: [:x :y | x addLast: (aBlock value: y) . x ] ) | copyFrom: start to: stop | newcol | newcol <- List new. (start to: stop) do: [:i | newcol addLast: (self at: i)]. ^ self coerce: newcol | copyWith: newElement ^ self coerce: (List new ; addAllLast: self ; addLast: newElement ) | copyWithout: oldElement | newcol | newcol <- List new. self do: [ :x | (x == oldElement) ifFalse: [ newcol addLast: x ]]. ^ self coerce: newcol | equals: aSubCollection startingAt: anIndex | i | i <- 0. self do: [:x | (x = (aSubCollection at: (anIndex + i) ifAbsent: [^ false])) ifFalse: [^ false]. i <- i + 1]. ^ true | findFirst: aBlock ^ self findFirst: aBlock ifAbsent: [self error: 'first element not found'] | findFirst: aBlock ifAbsent: exceptionBlock self do: [:x | (aBlock value: x) ifTrue: [ ^ self currentKey]]. ^ exceptionBlock value | findLast: aBlock self findLast: aBlock ifAbsent: [self error: 'last element not found'] | findLast: aBlock ifAbsent: exceptionBlock self reverseDo: [:x | (aBlock value: x) ifTrue: [ ^ self currentKey]]. ^ exceptionBlock value | indexOfSubCollection: aSubCollection startingAt: anIndex ifAbsent: exceptionBlock | n m | n <- anIndex. m <- self size - aSubCollection size. [n <= m] whileTrue: [(aSubCollection equals: self startingAt: n) ifTrue: [^ n]. n <- n + 1]. ^ exceptionBlock value | indexOfSubCollection: aSubCollection startingAt: anIndex ^ self indexOfSubCollection: aSubCollection startingAt: anIndex ifAbsent: [ self error: 'element not found'. nil] | last ^ (0 = self size) ifFalse: [ self at: self lastKey ] | replaceFrom: start to: stop with: repcol repcol inject: start into: [:x :y | self at: x put: y. x + 1] | replaceFrom: first to: stop with: repcol startingAt: repStart | i | i <- 0 . [(first + i) <= stop] whileTrue: [self at: (first + i) put: (repcol at: i + repStart). i <- i + 1 ] | reverseDo: aBlock | n m | n <- self lastKey. m <- self firstKey. [n >= m] whileTrue: [(self includesKey: n) ifTrue: [aBlock value: (self at: n)]. n <- n - 1]. ^ nil | reversed | newar i | newar <- Array new: (i <- self size). self do: [:x | newar at: i put: x. i <- i - 1]. ^ self coerce: newar | select: aBlock ^ self coerce: (self inject: List new into: [:x :y | (aBlock value: y) ifTrue: [x addLast: y]. x ] ) | sort ^ self sort: [:x :y | x <= y] | sort: sortBlock | index temp newArray | newArray <- self asArray. (2 to: newArray size) do: [ :highIndex | index <- highIndex - 1. [(index >= 1) and: [(sortBlock value: (newArray at: index) value: (newArray at: (index + 1))) not]] whileTrue: [temp <- newArray at: index. newArray at: index put: (newArray at: index + 1). newArray at: index + 1 put: temp. index <- index - 1 ]]. ^ self coerce: newArray | with: aSequenceableCollection do: aBlock | arg1 arg2 | arg1 <- self first. arg2 <- aSequenceableCollection first. [ arg1 notNil] whileTrue: [ aBlock value: arg1 value: arg2. arg1 <- self next. arg2 <- aSequenceableCollection next]. ^ nil ] SHAR_EOF if test 4499 -ne "`wc -c < 'scollection.st'`" then echo shar: error transmitting "'scollection.st'" '(should have been 4499 characters)' fi fi # end of overwriting check if test -f 'semaphore.st' then echo shar: will not over-write existing file "'semaphore.st'" else cat << \SHAR_EOF > 'semaphore.st' Class Semaphore :List | excessSignals | [ new excessSignals <- 0 | new: aNumber excessSignals <- aNumber | signal . "start atomic action" (self isEmpty) ifTrue: [excessSignals <- excessSignals + 1] ifFalse: [self removeFirst unblock]. "end atomic action" | wait . "start atomic actions" (excessSignals = 0) ifTrue: [self addLast: selfProcess. selfProcess block] ifFalse: [excessSignals <- excessSignals - 1]. "end atomic actions" ] SHAR_EOF if test 530 -ne "`wc -c < 'semaphore.st'`" then echo shar: error transmitting "'semaphore.st'" '(should have been 530 characters)' fi fi # end of overwriting check if test -f 'set.st' then echo shar: will not over-write existing file "'set.st'" else cat << \SHAR_EOF > 'set.st' Class Set :Collection | list | [ new list <- List new | add: newElement (list includes: newElement) ifFalse: [list add: newElement] | remove: oldElement ifAbsent: exceptionBlock list remove: oldElement ifAbsent: exceptionBlock | size ^ list size | occurrencesOf: anElement ^ (list includes: anElement) ifTrue: [1] ifFalse: [0] | first ^ list first | next ^ list next ] SHAR_EOF if test 506 -ne "`wc -c < 'set.st'`" then echo shar: error transmitting "'set.st'" '(should have been 506 characters)' fi fi # end of overwriting check if test -f 'smalltalk.st' then echo shar: will not over-write existing file "'smalltalk.st'" else cat << \SHAR_EOF > 'smalltalk.st' Class Smalltalk :Dictionary [ date ^ | debug: n ^ | display ^ | displayAssign ^ | doPrimitive: primNumber withArguments: argArray ^ | noDisplay ^ | perform: aMessage withArguments: argArray ^ | sh: command ^ | time: aBlock | start | start <- . aBlock value. ^ - start ] SHAR_EOF if test 517 -ne "`wc -c < 'smalltalk.st'`" then echo shar: error transmitting "'smalltalk.st'" '(should have been 517 characters)' fi fi # end of overwriting check if test -f 'string.st' then echo shar: will not over-write existing file "'string.st'" else cat << \SHAR_EOF > 'string.st' Class String :ArrayedCollection [ , aString ^ | = aString ^ ifTrue: [ = 0] ifFalse: [self compareError] | < aString ^ ifTrue: [ < 0] ifFalse: [self compareError] | <= aString ^ ifTrue: [ <= 0] ifFalse: [self compareError] | >= aString ^ ifTrue: [ >= 0] ifFalse: [self compareError] | > aString ^ ifTrue: [ > 0] ifFalse: [self compareError] | asSymbol ^ | at: aNumber ^ | at: aNumber put: aChar | compareError ^ self error: 'strings can only be compared to strings' | copyFrom: start to: stop ^ | copyFrom: start length: len ^ | deepCopy ^ | new: size ^ | printString ^ | print | size ^ | sameAs: aString ^ ifTrue: [] ifFalse: [self compareError] ] SHAR_EOF if test 1376 -ne "`wc -c < 'string.st'`" then echo shar: error transmitting "'string.st'" '(should have been 1376 characters)' fi fi # end of overwriting check if test -f 'symbol.st' then echo shar: will not over-write existing file "'symbol.st'" else cat << \SHAR_EOF > 'symbol.st' Class Symbol [ == aSymbol ^ ifTrue: [] ifFalse: [false] | printString ^ | asString ^ ] SHAR_EOF if test 200 -ne "`wc -c < 'symbol.st'`" then echo shar: error transmitting "'symbol.st'" '(should have been 200 characters)' fi fi # end of overwriting check if test -f 'test.st' then echo shar: will not over-write existing file "'test.st'" else cat << \SHAR_EOF > 'test.st' Class Test | var | [ printString ^ 'test value ', var printString | set: aVal var <- aVal ] SHAR_EOF if test 99 -ne "`wc -c < 'test.st'`" then echo shar: error transmitting "'test.st'" '(should have been 99 characters)' fi fi # end of overwriting check if test -f 'tests.st' then echo shar: will not over-write existing file "'tests.st'" else cat << \SHAR_EOF > 'tests.st' Class One | two | [ start ^ self one | one two <- Two new. two two: self | three two four ] Class Two [ two: back back three | four 'in four' print. self gak ] SHAR_EOF if test 180 -ne "`wc -c < 'tests.st'`" then echo shar: error transmitting "'tests.st'" '(should have been 180 characters)' fi fi # end of overwriting check if test -f 'true.st' then echo shar: will not over-write existing file "'true.st'" else cat << \SHAR_EOF > 'true.st' Class True :Boolean [ ifTrue: trueAlternativeBlock ifFalse: falseAlternativeBlock ^ trueAlternativeBlock value ! ifFalse: falseAlternativeBlock ifTrue: trueAlternativeBlock ^ trueAlternativeBlock value ! ifTrue: trueAlternativeBlock ^ trueAlternativeBlock value ! ifFalse: falseAlternativeBlock ^ nil | not ^ false ] SHAR_EOF if test 433 -ne "`wc -c < 'true.st'`" then echo shar: error transmitting "'true.st'" '(should have been 433 characters)' fi fi # end of overwriting check if test -f 'class.p' then echo shar: will not over-write existing file "'class.p'" else cat << \SHAR_EOF > 'class.p' temp <- > SHAR_EOF if test 1351 -ne "`wc -c < 'class.p'`" then echo shar: error transmitting "'class.p'" '(should have been 1351 characters)' fi fi # end of overwriting check if test -f 'object.p' then echo shar: will not over-write existing file "'object.p'" else cat << \SHAR_EOF > 'object.p' temp <- > SHAR_EOF if test 2344 -ne "`wc -c < 'object.p'`" then echo shar: error transmitting "'object.p'" '(should have been 2344 characters)' fi fi # end of overwriting check if test -f 'string.p' then echo shar: will not over-write existing file "'string.p'" else cat << \SHAR_EOF > 'string.p' temp <- " \ #( #[ 32 33 250 2 6 247 9 32 33 250 2 101 80 204 248 \ 4 242 32 10 19 243 245] \ #( ) ) > = " \ #( #[ 32 33 250 2 6 247 9 32 33 250 2 101 80 203 248 \ 4 242 32 10 19 243 245] \ #( ) ) > #>= #<= #< #= #, ) \ temp 3 5 > > SHAR_EOF if test 2112 -ne "`wc -c < 'string.p'`" then echo shar: error transmitting "'string.p'" '(should have been 2112 characters)' fi fi # end of overwriting check if test -f 'larray.p' then echo shar: will not over-write existing file "'larray.p'" else cat << \SHAR_EOF > 'larray.p' temp <- > SHAR_EOF if test 250 -ne "`wc -c < 'larray.p'`" then echo shar: error transmitting "'larray.p'" '(should have been 250 characters)' fi fi # end of overwriting check if test -f 'nil.p' then echo shar: will not over-write existing file "'nil.p'" else cat << \SHAR_EOF > 'nil.p' temp <- > SHAR_EOF if test 409 -ne "`wc -c < 'nil.p'`" then echo shar: error transmitting "'nil.p'" '(should have been 409 characters)' fi fi # end of overwriting check if test -f 'array.p' then echo shar: will not over-write existing file "'array.p'" else cat << \SHAR_EOF > 'array.p' temp <- > SHAR_EOF if test 904 -ne "`wc -c < 'array.p'`" then echo shar: error transmitting "'array.p'" '(should have been 904 characters)' fi fi # end of overwriting check if test -f 'boolean.p' then echo shar: will not over-write existing file "'boolean.p'" else cat << \SHAR_EOF > 'boolean.p' temp <- > SHAR_EOF if test 634 -ne "`wc -c < 'boolean.p'`" then echo shar: error transmitting "'boolean.p'" '(should have been 634 characters)' fi fi # end of overwriting check if test -f 'true.p' then echo shar: will not over-write existing file "'true.p'" else cat << \SHAR_EOF > 'true.p' temp <- > SHAR_EOF if test 577 -ne "`wc -c < 'true.p'`" then echo shar: error transmitting "'true.p'" '(should have been 577 characters)' fi fi # end of overwriting check if test -f 'false.p' then echo shar: will not over-write existing file "'false.p'" else cat << \SHAR_EOF > 'false.p' temp <- > SHAR_EOF if test 580 -ne "`wc -c < 'false.p'`" then echo shar: error transmitting "'false.p'" '(should have been 580 characters)' fi fi # end of overwriting check if test -f 'block.p' then echo shar: will not over-write existing file "'block.p'" else cat << \SHAR_EOF > 'block.p' temp <- > SHAR_EOF if test 1632 -ne "`wc -c < 'block.p'`" then echo shar: error transmitting "'block.p'" '(should have been 1632 characters)' fi fi # end of overwriting check if test -f 'symbol.p' then echo shar: will not over-write existing file "'symbol.p'" else cat << \SHAR_EOF > 'symbol.p' temp <- > SHAR_EOF if test 452 -ne "`wc -c < 'symbol.p'`" then echo shar: error transmitting "'symbol.p'" '(should have been 452 characters)' fi fi # end of overwriting check if test -f 'magnitude.p' then echo shar: will not over-write existing file "'magnitude.p'" else cat << \SHAR_EOF > 'magnitude.p' temp <- " \ #( #[ 33 32 199 243 245] \ #( ) ) > = " \ #( #[ 32 33 204 251 3 32 33 201 243 245] \ #( ) ) > 'number.p' temp <- " \ #( #[ 32 33 11 34 33 32 11 34 204 243 245] \ #( ) ) > #< #= #maxtype: ) \ temp 3 6 > > SHAR_EOF if test 3046 -ne "`wc -c < 'number.p'`" then echo shar: error transmitting "'number.p'" '(should have been 3046 characters)' fi fi # end of overwriting check if test -f 'integer.p' then echo shar: will not over-write existing file "'integer.p'" else cat << \SHAR_EOF > 'integer.p' temp <- " \ #( #[ 32 33 250 2 6 247 7 32 33 250 2 13 248 5 242 \ 32 33 145 0 243 245] \ #( #> ) ) > 'char.p' temp <- " \ #( #[ 32 33 250 2 6 247 7 32 33 250 2 43 248 4 242 \ 32 10 19 243 245] \ #( ) ) > #= #< #== ) \ temp 2 4 > > SHAR_EOF if test 2174 -ne "`wc -c < 'char.p'`" then echo shar: error transmitting "'char.p'" '(should have been 2174 characters)' fi fi # end of overwriting check if test -f 'float.p' then echo shar: will not over-write existing file "'float.p'" else cat << \SHAR_EOF > 'float.p' temp <- " \ #( #[ 32 33 250 2 6 247 7 32 33 250 2 63 248 5 242 \ 32 33 145 0 243 245] \ #( #> ) ) > 'radian.p' temp <- > SHAR_EOF if test 848 -ne "`wc -c < 'radian.p'`" then echo shar: error transmitting "'radian.p'" '(should have been 848 characters)' fi fi # end of overwriting check if test -f 'point.p' then echo shar: will not over-write existing file "'point.p'" else cat << \SHAR_EOF > 'point.p' temp <- = " \ #( #[ 16 33 10 49 203 252 5 17 33 10 50 203 243 245] \ #( ) ) > = #<= #< ) \ temp 3 4 > > SHAR_EOF if test 2339 -ne "`wc -c < 'point.p'`" then echo shar: error transmitting "'point.p'" '(should have been 2339 characters)' fi fi # end of overwriting check if test -f 'random.p' then echo shar: will not over-write existing file "'random.p'" else cat << \SHAR_EOF > 'random.p' temp <- > SHAR_EOF if test 880 -ne "`wc -c < 'random.p'`" then echo shar: error transmitting "'random.p'" '(should have been 880 characters)' fi fi # end of overwriting check if test -f 'collection.p' then echo shar: will not over-write existing file "'collection.p'" else cat << \SHAR_EOF > 'collection.p' temp <- > SHAR_EOF if test 3180 -ne "`wc -c < 'collection.p'`" then echo shar: error transmitting "'collection.p'" '(should have been 3180 characters)' fi fi # end of overwriting check if test -f 'bag.p' then echo shar: will not over-write existing file "'bag.p'" else cat << \SHAR_EOF > 'bag.p' temp <- > SHAR_EOF if test 1200 -ne "`wc -c < 'bag.p'`" then echo shar: error transmitting "'bag.p'" '(should have been 1200 characters)' fi fi # end of overwriting check if test -f 'set.p' then echo shar: will not over-write existing file "'set.p'" else cat << \SHAR_EOF > 'set.p' temp <- > SHAR_EOF if test 788 -ne "`wc -c < 'set.p'`" then echo shar: error transmitting "'set.p'" '(should have been 788 characters)' fi fi # end of overwriting check if test -f 'kcollection.p' then echo shar: will not over-write existing file "'kcollection.p'" else cat << \SHAR_EOF > 'kcollection.p' temp <- > SHAR_EOF if test 2622 -ne "`wc -c < 'kcollection.p'`" then echo shar: error transmitting "'kcollection.p'" '(should have been 2622 characters)' fi fi # end of overwriting check if test -f 'dictionary.p' then echo shar: will not over-write existing file "'dictionary.p'" else cat << \SHAR_EOF > 'dictionary.p' temp <- > SHAR_EOF if test 2139 -ne "`wc -c < 'dictionary.p'`" then echo shar: error transmitting "'dictionary.p'" '(should have been 2139 characters)' fi fi # end of overwriting check if test -f 'scollection.p' then echo shar: will not over-write existing file "'scollection.p'" else cat << \SHAR_EOF > 'scollection.p' temp <- > SHAR_EOF if test 3846 -ne "`wc -c < 'scollection.p'`" then echo shar: error transmitting "'scollection.p'" '(should have been 3846 characters)' fi fi # end of overwriting check if test -f 'interval.p' then echo shar: will not over-write existing file "'interval.p'" else cat << \SHAR_EOF > 'interval.p' temp <- > SHAR_EOF if test 1805 -ne "`wc -c < 'interval.p'`" then echo shar: error transmitting "'interval.p'" '(should have been 1805 characters)' fi fi # end of overwriting check if test -f 'list.p' then echo shar: will not over-write existing file "'list.p'" else cat << \SHAR_EOF > 'list.p' temp <- > SHAR_EOF if test 2388 -ne "`wc -c < 'list.p'`" then echo shar: error transmitting "'list.p'" '(should have been 2388 characters)' fi fi # end of overwriting check if test -f 'acollection.p' then echo shar: will not over-write existing file "'acollection.p'" else cat << \SHAR_EOF > 'acollection.p' temp <- 'file.p' temp <- > SHAR_EOF if test 1377 -ne "`wc -c < 'file.p'`" then echo shar: error transmitting "'file.p'" '(should have been 1377 characters)' fi fi # end of overwriting check if test -f 'bytearray.p' then echo shar: will not over-write existing file "'bytearray.p'" else cat << \SHAR_EOF > 'bytearray.p' temp <- > SHAR_EOF if test 712 -ne "`wc -c < 'bytearray.p'`" then echo shar: error transmitting "'bytearray.p'" '(should have been 712 characters)' fi fi # end of overwriting check if test -f 'semaphore.p' then echo shar: will not over-write existing file "'semaphore.p'" else cat << \SHAR_EOF > 'semaphore.p' temp <- > SHAR_EOF if test 648 -ne "`wc -c < 'semaphore.p'`" then echo shar: error transmitting "'semaphore.p'" '(should have been 648 characters)' fi fi # end of overwriting check if test -f 'process.p' then echo shar: will not over-write existing file "'process.p'" else cat << \SHAR_EOF > 'process.p' temp <- > SHAR_EOF if test 1481 -ne "`wc -c < 'process.p'`" then echo shar: error transmitting "'process.p'" '(should have been 1481 characters)' fi fi # end of overwriting check if test -f 'smalltalk.p' then echo shar: will not over-write existing file "'smalltalk.p'" else cat << \SHAR_EOF > 'smalltalk.p' temp <- > SHAR_EOF if test 1062 -ne "`wc -c < 'smalltalk.p'`" then echo shar: error transmitting "'smalltalk.p'" '(should have been 1062 characters)' fi fi # end of overwriting check if test -f 'standard' then echo shar: will not over-write existing file "'standard'" else cat << \SHAR_EOF > 'standard' temp <- > temp <- > temp <- " \ #( #[ 32 33 250 2 6 247 9 32 33 250 2 101 80 204 248 \ 4 242 32 10 19 243 245] \ #( ) ) > = " \ #( #[ 32 33 250 2 6 247 9 32 33 250 2 101 80 203 248 \ 4 242 32 10 19 243 245] \ #( ) ) > #>= #<= #< #= #, ) \ temp 3 5 > > temp <- > temp <- > temp <- > temp <- > temp <- > temp <- > temp <- > temp <- > temp <- " \ #( #[ 33 32 199 243 245] \ #( ) ) > = " \ #( #[ 32 33 204 251 3 32 33 201 243 245] \ #( ) ) > " \ #( #[ 32 33 11 34 33 32 11 34 204 243 245] \ #( ) ) > #< #= #maxtype: ) \ temp 3 6 > > temp <- " \ #( #[ 32 33 250 2 6 247 7 32 33 250 2 13 248 5 242 \ 32 33 145 0 243 245] \ #( #> ) ) > " \ #( #[ 32 33 250 2 6 247 7 32 33 250 2 43 248 4 242 \ 32 10 19 243 245] \ #( ) ) > #= #< #== ) \ temp 2 4 > > temp <- " \ #( #[ 32 33 250 2 6 247 7 32 33 250 2 63 248 5 242 \ 32 33 145 0 243 245] \ #( #> ) ) > > temp <- = " \ #( #[ 16 33 10 49 203 252 5 17 33 10 50 203 243 245] \ #( ) ) > = #<= #< ) \ temp 3 4 > > temp <- > temp <- > temp <- > temp <- > temp <- > temp <- > temp <- > temp <- > temp <- > temp <- > temp <- > temp <- > temp <- > temp <- > smalltalk new SHAR_EOF if test 52853 -ne "`wc -c < 'standard'`" then echo shar: error transmitting "'standard'" '(should have been 52853 characters)' fi fi # end of overwriting check if test -f 'stdsave' then echo shar: will not over-write existing file "'stdsave'" else cat << \SHAR_EOF > 'stdsave' ol spacellLast:From:reysSelect:emoveKey:alue:h l!l'l-()[]!|.;>enhighlow error: %dbA2.10000000D'y.s 85/03/06Lt char! (] r""![" .r\ r""s #s 0#!s# q!!r "r 0"r" ! ![\ q!P rQ! "# #op" ! ) y[]\! r""![" .r\ ! z r" !" r q!P rQ! "# #o p" * ! ! ! ! ! !f d y m!s k !"j !"!Qj 0 !"i !h l ! !eP ! !eP ! !eP ! !eP ! !eP !gQ0\[ 0q r"P "o1 ! q"Qr2! !Q! 0] !"p"!Q! 0] !o!r ! ! ! ! ! !\]!"![!]!"UTSRQP ! ] ! ] ! # (] ! /! ! ] \ ! !.\ ! ! ! ! ! "! ! ! ! ! !! ! ! ! )!. !"+ PZ PQP ! 0 ! 6 P 0 PP P ! PP 5 2! 3 ! ! "! " ! "! " ! "! " ! "! " ! "! " ! "! " ! "! " ! ! Pr" !"Qr ! ! # ! ! ! # RPP ! ! ! ! # " ! ! # & RP ! ! ! ! ! ! % ' $! !0 : ! PZQr"! # ! ! # ! ! ! ! ! 01 8 2q 0! 0 : 5 9 6 9 ; ! !+ ! !. ! !* 0 I H G 0H !Y F K M L H O! I N 6 T6 U!P ! !X !0 QRRQ!!!P`!a!`"a!`5 2 30 5! 1 2! 2 35! 1 2! 2 3! 1 ,! 2 , + 0 5 2 35! 2! 35! 2! 35! 1 2! 2 35! 1 2! 2 35! 2! 3! 1! 2! 1! 2! 1! 2! 1! 2!rQ!"# " ! /Q "!!#` #` ! "!#" r!"#": Q a]]!`c"a#bP!"!"sQ#! (!#Q" !!!Q!P(`9q !" !! QP!"! !0` q !"! ( !#" #" 0 ! 0! 0 (!#" #" ! #! " ! 0 !\[ ( " !#" ! #]! #" ! !0 !(q !"# !! "# ! 00r!"# "!ab] q!! 1 0 ! 1 " 2 3 q! 2Qa q! 2]Q " q! 2]" # 1!#] ! s !#t$"#$" 2 ! s !#t$"$ 2 ! s !#t$5! 2" 3t#$$" 3" ! s#r"0r#""!Q` s!t#"#$ s!t] tR$3%Qr"Q !$"$"Q$"s$"$"Q$"Q#"Qr. $ !" . 0 !#"# " rq !"#"Qr ! r s"# " 4! ""Qr]Pu!%" !%#%$%Qu#! $%$QP !" 0]"t !u$%! $$$Qt# !# *" ! 0 !# " ! 0Ps $!"#\\#Qs[0r #!"# " 0 ! 0s!"# $ # 0 "!# " 0 ! 0" 0 0!0 1 2 !Qs # #"c c !! !!P QY0p` 1 1 2a 1a 1 % % %q 2`! 1 0" ] 1!# 2`# 2 3!" ! 0q]! 2! 2q!! " ! " ! 5! 2] 3 3!5! 2 3`!5! 2 3`!Q "`! " qQ !" "!Q` QQ` qQ !" " !"!Qs #t$Q# !$ P ! " 1 ! $ Q R P u0qQ ! " 1 q!2 !"w !v!t _ _ Q`Q` & 0-0 1 /] S -0! 1 - q!P0q!!Q1q!!R2q!!S2q!!T3q! -0 1 /] Q - -0 1 /] P - -0 1 /] R - ittle Smalltalk `pp`pa` #( ) ) > > smalltalk new time: " \ #( #[ 250 0 161 114 33 165 242 250 0 161 34 193 243 245] \ #( ) ) >