'From Squeak2.8 of 23 June 2000 [latest update: #2342] on 7 July 2000 at 11:46:27 am'! "Change Set: JMMChgFlowPreSetup Date: 3 July 2000 Author: Craig Latta Changes by johnmci@smalltalkconsulting.com JMM A prereq for correspondents. I broke out these changes to the base system for correspondents1b4 so you can understand the impact. For documentation see the original author's web pages at http://netjam.org/self/projects/smalltalk "! Smalltalk renameClassNamed: #SerialPort as: #OldSerialPort! !OldSerialPort commentStamp: '' prior: 0! This class supports a simple interface to the serial ports of the underlying platform, if it supports serial ports. The mapping of port numbers to hardware ports is platform specific, but typically follows platform ordering conventions. For example, on the Macintosh, port 0 is the modem port and port 1 is the printer port, since in the programmers documentation these ports are referred to as ports A and B. ! !Object methodsFor: 'printing' stamp: 'crl 10/20/1999 10:59'! printVerboselyOn: aStream "Print a verbose character-based representation of myself on aStream." "By default, print normally." self printOn: aStream! ! !Object methodsFor: 'enumerating' stamp: 'crl 3/8/1999 18:00'! do: aBlockClosure "Evaluate aBlockClosure with each element of myself (that is, with myself)." aBlockClosure value: self! ! !Boolean methodsFor: 'controlling' stamp: 'crl 3/15/1999 23:57'! yourselfUnlessFalseDoFirst: aBlockClosure "Answer myself. If I'm false, evaluate aBlockClosure first." self subclassResponsibility! ! !Boolean methodsFor: 'controlling' stamp: 'crl 3/15/1999 23:56'! yourselfUnlessTrue: aBlockClosure "Answer myself, unless I'm true, in which case evaluate aBlockClosure." self subclassResponsibility! ! !Boolean methodsFor: 'controlling' stamp: 'crl 10/20/1999 10:57'! yourselfUnlessTrueDoFirst: aBlockClosure "Answer myself. If I'm true, evaluate aBlockClosure first."! ! !Character methodsFor: 'testing' stamp: 'crl 10/19/1999 20:06'! isEOL ^value = 13 or: [value = 10]! ! !Collection methodsFor: 'printing'! printOn: aStream withDelimiter: delimiter "Print my elements on aStream with delimiter." | stream | self isEmpty ifFalse: [ stream _ self stream. "Make sure there isn't a dangling delimiter at the end." aStream nextPutAll: (stream next stringRepresentation). "Print the delimiter and the next element" [stream atEnd] whileFalse: [ delimiter == nil ifFalse: [aStream nextPutAll: delimiter]. aStream nextPutAll: (stream next stringRepresentation)]]! ! !Collection methodsFor: 'printing' stamp: 'crl 10/20/1999 10:58'! printVerboselyOn: aStream "Print a verbose character-based representation of myself on aStream." | size | size _ self size. size = 0 ifTrue: [aStream nextPutAll: '(nothing)'] ifFalse: [ aStream printVerbosely: (self at: 1). size = 1 ifFalse: [ (self copyFrom: 2 to: size - 1) do: [:element | aStream nextPutAll: ', '; printVerbosely: element]. size > 2 ifTrue: [aStream nextPutAll: ', '] ifFalse: [aStream space]. aStream nextPutAll: 'and '; printVerbosely: (self at: size)]]! ! !False methodsFor: 'controlling' stamp: 'crl 3/15/1999 23:58'! yourselfUnlessFalseDoFirst: aBlockClosure "Answer myself. If I'm false, evaluate aBlockClosure first." aBlockClosure value. ^self! ! !False methodsFor: 'controlling' stamp: 'crl 3/15/1999 23:56'! yourselfUnlessTrue: aBlockClosure "Answer myself, unless I'm true, in which case evaluate aBlockClosure."! ! !PositionableStream methodsFor: 'accessing' stamp: 'crl 10/19/1999 20:08'! nextLine "Assuming my elements are characters, answer the next characters up to an end-of-line character." | line | line _ self nextUntil: [:ch | ch isEOL]. self atEnd ifFalse: [self skip: 1]. ^line! ! !SequenceableCollection methodsFor: 'copying' stamp: 'crl 3/16/1999 06:38'! copyTo: index "Answer a copy of myself from the beginning to index." ^self copyFrom: 1 to: index! ! !OrderedCollection methodsFor: 'removing' stamp: 'crl 10/19/1999 20:01'! removeFirst: anInteger "Answer the first anInteger elements, removing them." | elements | elements _ OrderedCollection new: anInteger. anInteger timesRepeat: [elements add: self removeFirst]. ^elements! ! !OrderedCollection methodsFor: 'converting' stamp: 'crl 10/19/1999 20:04'! asByteArray "Answer myself as a ByteArray." ^ByteArray newFrom: (self collect: [:element | element asInteger])! ! !String methodsFor: 'accessing' stamp: 'crl 10/20/1999 09:17'! trimBlanksAndZeros "Return a new string that is the same as the receiver, with leading and trailing separators (and zeros) removed." | index endIndex | self isEmpty ifTrue: [^'']. index := 1. [index < self size and: [(self at: index) isSeparator | ((self at: index) asciiValue = 0)]] whileTrue: [index := index + 1]. endIndex := self size. [endIndex >= index and: [(self at: endIndex) isSeparator | ((self at: endIndex) asciiValue = 0)]] whileTrue: [endIndex := endIndex - 1]. ^self copyFrom: index to: endIndex! ! !SystemDictionary class methodsFor: 'initialization' stamp: 'JMM 6/23/2000 22:45'! initialize "SystemDictionary initialize" | oldList | oldList _ StartUpList. StartUpList _ OrderedCollection new. "These get processed from the top down..." Smalltalk addToStartUpList: DisplayScreen. Smalltalk addToStartUpList: Cursor. Smalltalk addToStartUpList: InputSensor. Smalltalk addToStartUpList: ProcessorScheduler. "Starts low space watcher and bkground." Smalltalk addToStartUpList: Delay. Smalltalk addToStartUpList: FileDirectory. "Enables file stack dump and opens sources." Smalltalk addToStartUpList: ShortIntegerArray. Smalltalk addToStartUpList: ShortRunArray. Smalltalk addToStartUpList: CrLfFileStream. oldList ifNotNil: [oldList do: [:className | Smalltalk at: className ifPresent: [:theClass | Smalltalk addToStartUpList: theClass]]]. Smalltalk addToStartUpList: ImageSegment. Smalltalk addToStartUpList: PasteUpMorph. Smalltalk addToStartUpList: ControlManager. Smalltalk addToStartUpList: InternetSocket. oldList _ ShutDownList. ShutDownList _ OrderedCollection new. "These get processed from the bottom up..." Smalltalk addToShutDownList: DisplayScreen. Smalltalk addToShutDownList: Form. Smalltalk addToShutDownList: ControlManager. Smalltalk addToShutDownList: StrikeFont. Smalltalk addToShutDownList: Color. Smalltalk addToShutDownList: FileDirectory. Smalltalk addToShutDownList: Delay. Smalltalk addToShutDownList: SoundPlayer. Smalltalk addToShutDownList: HttpUrl. Smalltalk addToShutDownList: Password. Smalltalk addToShutDownList: PWS. Smalltalk addToShutDownList: MailDB. Smalltalk addToShutDownList: ImageSegment. oldList ifNotNil: [oldList reverseDo: [:className | Smalltalk at: className ifPresent: [:theClass | Smalltalk addToShutDownList: theClass]]]. ! ! !True methodsFor: 'controlling' stamp: 'crl 3/15/1999 23:58'! yourselfUnlessFalseDoFirst: aBlockClosure "Answer myself. If I'm false, evaluate aBlockClosure first."! ! !True methodsFor: 'controlling' stamp: 'crl 3/15/1999 23:56'! yourselfUnlessTrue: aBlockClosure "Answer myself, unless I'm true, in which case evaluate aBlockClosure." ^aBlockClosure value! ! !True methodsFor: 'controlling' stamp: 'crl 10/20/1999 10:57'! yourselfUnlessTrueDoFirst: aBlockClosure "Answer myself. If I'm true, evaluate aBlockClosure first." aBlockClosure value! ! SystemDictionary initialize!