--- a/Class.st Mon Dec 11 18:30:57 1995 +0100
+++ b/Class.st Mon Dec 11 18:36:01 1995 +0100
@@ -1890,72 +1890,68 @@
"take care of nil-superclass"
superclass isNil ifTrue:[
-"/ previous versions of stc were not able to compile nil-subclasses;
-"/ after 2.10, it can ...
-"/ line := 'Object "nil"'.
- line := 'nil'
+ line := 'nil'
] ifFalse:[
- line := (superclass name)
+ line := (superclass name)
].
superclass isNil ifTrue:[
- isVar := self isVariable
+ isVar := self isVariable
] ifFalse:[
- "I cant remember what this is for ?"
- isVar := (self isVariable and:[superclass isVariable not])
+ "I cant remember what this is for ?"
+ isVar := (self isVariable and:[superclass isVariable not])
].
isVar ifTrue:[
- self isBytes ifTrue:[
- s := ' variableByteSubclass:#'
- ] ifFalse:[
- self isWords ifTrue:[
- s := ' variableWordSubclass:#'
- ] ifFalse:[
- self isLongs ifTrue:[
- s := ' variableLongSubclass:#'
- ] ifFalse:[
- self isFloats ifTrue:[
- s := ' variableFloatSubclass:#'
- ] ifFalse:[
- self isDoubles ifTrue:[
- s := ' variableDoubleSubclass:#'
- ] ifFalse:[
- s := ' variableSubclass:#'
- ]
- ]
- ]
- ]
- ]
+ self isBytes ifTrue:[
+ s := ' variableByteSubclass:#'
+ ] ifFalse:[
+ self isWords ifTrue:[
+ s := ' variableWordSubclass:#'
+ ] ifFalse:[
+ self isLongs ifTrue:[
+ s := ' variableLongSubclass:#'
+ ] ifFalse:[
+ self isFloats ifTrue:[
+ s := ' variableFloatSubclass:#'
+ ] ifFalse:[
+ self isDoubles ifTrue:[
+ s := ' variableDoubleSubclass:#'
+ ] ifFalse:[
+ s := ' variableSubclass:#'
+ ]
+ ]
+ ]
+ ]
+ ]
] ifFalse:[
- s := ' subclass:#'
+ s := ' subclass:#'
].
line := line , s , name.
aStream nextPutAll:line.
aStream crtab.
- aStream nextPutAll:' instanceVariableNames:'''.
+ aStream nextPutAll:'instanceVariableNames:'''.
self printInstVarNamesOn:aStream indent:16.
aStream nextPutAll:''''.
aStream crtab.
- aStream nextPutAll:' classVariableNames:'''.
+ aStream nextPutAll:'classVariableNames:'''.
self printClassVarNamesOn:aStream indent:16.
aStream nextPutAll:''''.
aStream crtab.
- aStream nextPutAll:' poolDictionaries:'''''.
+ aStream nextPutAll:'poolDictionaries:'''''.
aStream crtab.
- aStream nextPutAll:' category:'.
+ aStream nextPutAll:'category:'.
category isNil ifTrue:[
- s := ''''''
+ s := ''''''
] ifFalse:[
- s := category asString storeString
+ s := category asString storeString
].
aStream nextPutAll:s.
aStream cr
- "Created: 10.12.1995 / 16:30:54 / cg"
"Modified: 10.12.1995 / 16:31:50 / cg"
!
@@ -2176,11 +2172,11 @@
aStream cr; cr; nextPut:(Character doubleQuote); cr.
aStream space;
- nextPutAll:'The following class instance variables are inherited by this class:';
- cr; cr.
+ nextPutAll:'The following class instance variables are inherited by this class:';
+ cr; cr.
self allSuperclassesDo:[:aSuperClass |
- aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '.
- aStream nextPutAll:(aSuperClass class instanceVariableString); cr.
+ aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '.
+ aStream nextPutAll:(aSuperClass class instanceVariableString); cr.
].
aStream nextPut:(Character doubleQuote); cr.
@@ -2314,9 +2310,9 @@
|collectionOfCategories copyrightMethod copyrightText comment cls versionMethod skippedMethods|
self isLoaded ifFalse:[
- ^ FileOutErrorSignal
- raiseRequestWith:self
- errorString:'will not fileOut unloaded classes'
+ ^ FileOutErrorSignal
+ raiseRequestWith:self
+ errorString:'will not fileOut unloaded classes'
].
"
@@ -2329,36 +2325,36 @@
code was edited in the browser and filedOut.
"
(copyrightMethod := self class compiledMethodAt:#copyright) notNil ifTrue:[
- "
- get the copyright methods source,
- and insert at beginning.
- "
- copyrightText := copyrightMethod source.
- copyrightText isNil ifTrue:[
- "
- no source available - trigger an error
- "
- FileOutErrorSignal
- raiseRequestWith:'no source for class ' , name , ' available. Cannot fileOut'.
- ^ self
- ].
- "
- strip off the selector-line
- "
- copyrightText := copyrightText asCollectionOfLines asStringCollection.
- copyrightText := copyrightText copyFrom:2 to:(copyrightText size).
+ "
+ get the copyright methods source,
+ and insert at beginning.
+ "
+ copyrightText := copyrightMethod source.
+ copyrightText isNil ifTrue:[
+ "
+ no source available - trigger an error
+ "
+ FileOutErrorSignal
+ raiseRequestWith:'no source for class ' , name , ' available. Cannot fileOut'.
+ ^ self
+ ].
+ "
+ strip off the selector-line
+ "
+ copyrightText := copyrightText asCollectionOfLines asStringCollection.
+ copyrightText := copyrightText copyFrom:2 to:(copyrightText size).
"/ copyrightText do:[:line | aStream nextPutAll:line. aStream cr.].
- copyrightText := copyrightText asString.
- aStream nextPutAllAsChunk:copyrightText.
+ copyrightText := copyrightText asString.
+ aStream nextPutAllAsChunk:copyrightText.
].
stampIt ifTrue:[
- "/
- "/ first, a timestamp
- "/
- aStream nextPutAll:(Smalltalk timeStamp).
- aStream nextPutChunkSeparator.
- aStream cr; cr.
+ "/
+ "/ first, a timestamp
+ "/
+ aStream nextPutAll:(Smalltalk timeStamp).
+ aStream nextPutChunkSeparator.
+ aStream cr; cr.
].
"/
@@ -2372,19 +2368,19 @@
"/ optional classInstanceVariables
"/
self class instanceVariableString isBlank ifFalse:[
- self fileOutClassInstVarDefinitionOn:aStream.
- aStream nextPutChunkSeparator.
- aStream cr; cr
+ self fileOutClassInstVarDefinitionOn:aStream.
+ aStream nextPutChunkSeparator.
+ aStream cr; cr
].
"/
"/ a comment - if any
"/
(comment := self comment) notNil ifTrue:[
- aStream nextPutAll:name; nextPutAll:' comment:'.
- aStream nextPutAll:(comment storeString).
- aStream nextPutChunkSeparator.
- aStream cr; cr
+ aStream nextPutAll:name; nextPutAll:' comment:'.
+ aStream nextPutAll:(comment storeString).
+ aStream nextPutChunkSeparator.
+ aStream cr; cr
].
"/
@@ -2399,41 +2395,41 @@
"/
collectionOfCategories := self class categories asSortedCollection.
collectionOfCategories notNil ifTrue:[
- "/
- "/ documentation first (if any), but not the version method
- "/
- (collectionOfCategories includes:'documentation') ifTrue:[
- versionMethod := self class compiledMethodAt:#version.
- versionMethod notNil ifTrue:[
- skippedMethods := Array with:versionMethod
- ].
- self class fileOutCategory:'documentation' except:skippedMethods only:nil on:aStream.
- aStream cr.
- ].
-
- "/
- "/ initialization next (if any)
- "/
- (collectionOfCategories includes:'initialization') ifTrue:[
- self class fileOutCategory:'initialization' on:aStream.
- aStream cr.
- ].
-
- "/
- "/ instance creation next (if any)
- "/
- (collectionOfCategories includes:'instance creation') ifTrue:[
- self class fileOutCategory:'instance creation' on:aStream.
- aStream cr.
- ].
- collectionOfCategories do:[:aCategory |
- ((aCategory ~= 'documentation')
- and:[(aCategory ~= 'initialization')
- and:[aCategory ~= 'instance creation']]) ifTrue:[
- self class fileOutCategory:aCategory on:aStream.
- aStream cr
- ]
- ]
+ "/
+ "/ documentation first (if any), but not the version method
+ "/
+ (collectionOfCategories includes:'documentation') ifTrue:[
+ versionMethod := self class compiledMethodAt:#version.
+ versionMethod notNil ifTrue:[
+ skippedMethods := Array with:versionMethod
+ ].
+ self class fileOutCategory:'documentation' except:skippedMethods only:nil on:aStream.
+ aStream cr.
+ ].
+
+ "/
+ "/ initialization next (if any)
+ "/
+ (collectionOfCategories includes:'initialization') ifTrue:[
+ self class fileOutCategory:'initialization' on:aStream.
+ aStream cr.
+ ].
+
+ "/
+ "/ instance creation next (if any)
+ "/
+ (collectionOfCategories includes:'instance creation') ifTrue:[
+ self class fileOutCategory:'instance creation' on:aStream.
+ aStream cr.
+ ].
+ collectionOfCategories do:[:aCategory |
+ ((aCategory ~= 'documentation')
+ and:[(aCategory ~= 'initialization')
+ and:[aCategory ~= 'instance creation']]) ifTrue:[
+ self class fileOutCategory:aCategory on:aStream.
+ aStream cr
+ ]
+ ]
].
"/
@@ -2441,26 +2437,26 @@
"/
collectionOfCategories := self categories asSortedCollection.
collectionOfCategories notNil ifTrue:[
- collectionOfCategories do:[:aCategory |
- self fileOutCategory:aCategory on:aStream.
- aStream cr
- ]
+ collectionOfCategories do:[:aCategory |
+ self fileOutCategory:aCategory on:aStream.
+ aStream cr
+ ]
].
"/
"/ finally, the previously skipped version method
"/
versionMethod notNil ifTrue:[
- self class fileOutCategory:'documentation' except:nil only:skippedMethods on:aStream.
+ self class fileOutCategory:'documentation' except:nil only:skippedMethods on:aStream.
].
"/
"/ optionally an initialize message
"/
(self class implements:#initialize) ifTrue:[
- aStream nextPutAll:(name , ' initialize').
- aStream nextPutChunkSeparator.
- aStream cr
+ aStream nextPutAll:(name , ' initialize').
+ aStream nextPutChunkSeparator.
+ aStream cr
]
"Created: 15.11.1995 / 12:53:06 / cg"
@@ -2594,37 +2590,37 @@
arraySize := anArray size.
arraySize ~~ 0 ifTrue:[
- pos := indent.
- lenMax := aStream lineLength.
- thisName := anArray at:1.
- line := ''.
- 1 to:arraySize do:[:index |
- line := line , thisName.
- pos := pos + thisName size.
- (index == arraySize) ifFalse:[
- nextName := anArray at:(index + 1).
- mustBreak := false.
- (lenMax > 0) ifTrue:[
- ((pos + nextName size) > lenMax) ifTrue:[
- mustBreak := true
- ]
- ].
- mustBreak ifTrue:[
- aStream nextPutAll:line withTabs.
- aStream cr.
- spaces isNil ifTrue:[
- spaces := String new:indent
- ].
- line := spaces.
- pos := indent
- ] ifFalse:[
- line := line , ' '.
- pos := pos + 1
- ].
- thisName := nextName
- ]
- ].
- aStream nextPutAll:line withTabs
+ pos := indent.
+ lenMax := aStream lineLength.
+ thisName := anArray at:1.
+ line := ''.
+ 1 to:arraySize do:[:index |
+ line := line , thisName.
+ pos := pos + thisName size.
+ (index == arraySize) ifFalse:[
+ nextName := anArray at:(index + 1).
+ mustBreak := false.
+ (lenMax > 0) ifTrue:[
+ ((pos + nextName size) > lenMax) ifTrue:[
+ mustBreak := true
+ ]
+ ].
+ mustBreak ifTrue:[
+ aStream nextPutAll:line withTabs.
+ aStream cr.
+ spaces isNil ifTrue:[
+ spaces := String new:indent
+ ].
+ line := spaces.
+ pos := indent
+ ] ifFalse:[
+ line := line , ' '.
+ pos := pos + 1
+ ].
+ thisName := nextName
+ ]
+ ].
+ aStream nextPutAll:line withTabs
]
"Created: 10.12.1995 / 16:34:23 / cg"
@@ -2692,9 +2688,9 @@
aPrintStream nextPutAll:'class '; bold; nextPutAll:name; normal; cr.
aPrintStream nextPutAll:'superclass '.
superclass isNil ifTrue:[
- s := 'Object'
+ s := 'Object'
] ifFalse:[
- s := superclass name
+ s := superclass name
].
aPrintStream nextPutAll:s.
aPrintStream cr.
@@ -2708,12 +2704,12 @@
aPrintStream cr.
category notNil ifTrue:[
- aPrintStream nextPutAll:'category '; nextPutAll:(category printString).
- aPrintStream cr
+ aPrintStream nextPutAll:'category '; nextPutAll:(category printString).
+ aPrintStream cr
].
(comment := self comment) notNil ifTrue:[
- aPrintStream cr; nextPutAll:'comment:'; cr; italic; nextPutAll:comment; normal; cr
+ aPrintStream cr; nextPutAll:'comment:'; cr; italic; nextPutAll:comment; normal; cr
]
"Created: 10.12.1995 / 16:30:47 / cg"
@@ -2904,24 +2900,24 @@
"return a dictionary filled with revision info.
This extracts the relevant info from the revisionString.
The revisionInfo contains all or a subset of:
- #binaryRevision - the revision upon which the binary of this class is based
- #revision - the revision upon which the class is based logically
- (different, if a changed class was checked in, but not yet recompiled)
- #user - the user who checked in the logical revision
- #date - the date when the logical revision was checked in
- #time - the time when the logical revision was checked in
- #fileName - the classes source file name
- #repositoryPath - the classes source container
+ #binaryRevision - the revision upon which the binary of this class is based
+ #revision - the revision upon which the class is based logically
+ (different, if a changed class was checked in, but not yet recompiled)
+ #user - the user who checked in the logical revision
+ #date - the date when the logical revision was checked in
+ #time - the time when the logical revision was checked in
+ #fileName - the classes source file name
+ #repositoryPath - the classes source container
"
|vsnString info|
vsnString := self revisionString.
vsnString notNil ifTrue:[
- info := Class revisionInfoFromString:vsnString.
- info notNil ifTrue:[
- info at:#binaryRevision put:revision.
- ]
+ info := Class revisionInfoFromString:vsnString.
+ info notNil ifTrue:[
+ info at:#binaryRevision put:revision.
+ ]
].
^ info
@@ -3011,7 +3007,7 @@
cls := self.
self isMeta ifFalse:[
- cls := self class
+ cls := self class
].
"/ m := cls compiledMethodAt:#version.
"/ m isNil ifTrue:[^ false].
@@ -3023,11 +3019,11 @@
"/ newString isNil ifTrue:[^ false].
Class withoutUpdatingChangesDo:[
- Compiler compile:'version
+ Compiler compile:'version
^ ''' , newRevisionString , '''
'
- forClass:cls inCategory:#documentation notifying:nil
- install:true skipIfSame:false silent:true.
+ forClass:cls inCategory:#documentation notifying:nil
+ install:true skipIfSame:false silent:true.
].
"/ ('updated to :' , newRevisionString) printNL.
@@ -3373,6 +3369,6 @@
!Class class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.105 1995-12-10 16:55:55 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.106 1995-12-11 17:36:01 cg Exp $'
! !
Class initialize!