120 |
120 |
121 (self == Autoload) ifTrue:[^ super fileOutDefinitionOn:aStream]. |
121 (self == Autoload) ifTrue:[^ super fileOutDefinitionOn:aStream]. |
122 |
122 |
123 myName := self name. |
123 myName := self name. |
124 aStream nextPutAll:'"' ; nextPutAll:'Notice from Autoload:'; cr; cr; |
124 aStream nextPutAll:'"' ; nextPutAll:'Notice from Autoload:'; cr; cr; |
125 spaces:4; nextPutAll:myName , ' is not yet loaded.'; cr; cr. |
125 spaces:4; nextPutAll:myName , ' is not yet loaded.'; cr; cr. |
126 aStream nextPutAll:'to load, execute: '. |
126 aStream nextPutAll:'to load, execute: '. |
127 aStream cr; cr; spaces:4; nextPutAll:myName , ' autoload'; cr. |
127 aStream cr; cr; spaces:4; nextPutAll:myName , ' autoload'; cr. |
128 |
128 |
129 " |
129 " |
130 the following is simply informative ... |
130 the following is simply informative ... |
132 in Smalltalk |
132 in Smalltalk |
133 (knowing the details of loading here is no good coding style) |
133 (knowing the details of loading here is no good coding style) |
134 " |
134 " |
135 fileName := Smalltalk fileNameForClass:myName. |
135 fileName := Smalltalk fileNameForClass:myName. |
136 (ObjectFileLoader notNil and:[Smalltalk loadBinaries]) ifTrue:[ |
136 (ObjectFileLoader notNil and:[Smalltalk loadBinaries]) ifTrue:[ |
137 (nm := Smalltalk libraryFileNameOfClass:myName) notNil ifTrue:[ |
137 (nm := Smalltalk libraryFileNameOfClass:myName) notNil ifTrue:[ |
138 nm := nm , ' (a classLibrary, possibly including more classes)' |
138 nm := nm , ' (a classLibrary, possibly including more classes)' |
139 ] ifFalse:[ |
139 ] ifFalse:[ |
140 nm := Smalltalk getBinaryFileName:(fileName , '.so'). |
140 nm := Smalltalk getBinaryFileName:(fileName , '.so'). |
141 nm isNil ifTrue:[ |
141 nm isNil ifTrue:[ |
142 nm := Smalltalk getBinaryFileName:(fileName , '.o') |
142 nm := Smalltalk getBinaryFileName:(fileName , '.o') |
143 ]. |
143 ]. |
144 nm notNil ifTrue:[ |
144 nm notNil ifTrue:[ |
145 nm := nm , ' (a classBinary)' |
145 nm := nm , ' (a classBinary)' |
146 ] |
146 ] |
147 ]. |
147 ]. |
148 ]. |
148 ]. |
149 nm isNil ifTrue:[ |
149 nm isNil ifTrue:[ |
150 nm := Smalltalk getFileInFileName:(fileName , '.st'). |
150 nm := Smalltalk getFileInFileName:(fileName , '.st'). |
151 nm isNil ifTrue:[ |
151 nm isNil ifTrue:[ |
152 nm := Smalltalk getSourceFileName:(fileName , '.st'). |
152 nm := Smalltalk getSourceFileName:(fileName , '.st'). |
153 ]. |
153 ]. |
154 ]. |
154 ]. |
155 nm notNil ifTrue:[ |
155 nm notNil ifTrue:[ |
156 aStream cr; nextPutAll:'When accessed, ' , myName , ' will automatically be loaded'; cr. |
156 aStream cr; nextPutAll:'When accessed, ' , myName , ' will automatically be loaded'; cr. |
157 aStream nextPutAll:'from: '; cr; spaces:4; nextPutAll:nm. |
157 aStream nextPutAll:'from: '; cr; spaces:4; nextPutAll:nm. |
158 nm asFilename isSymbolicLink ifTrue:[ |
158 nm asFilename isSymbolicLink ifTrue:[ |
159 aStream cr; cr. |
159 aStream cr; cr. |
160 aStream nextPutAll:'which is a link to: '; cr; spaces:4; |
160 aStream nextPutAll:'which is a link to: '; cr; spaces:4; |
161 nextPutAll:(nm asFilename linkInfo at:#path). |
161 nextPutAll:(nm asFilename linkInfo at:#path). |
162 ] |
162 ] |
163 ] ifFalse:[ |
163 ] ifFalse:[ |
164 aStream cr; nextPutAll:'There is currently no file to load ' , myName , ' from.'; cr; cr. |
164 aStream cr; nextPutAll:'There is currently no file to load ' , myName , ' from.'; cr; cr. |
165 |
165 |
166 (mgr := Smalltalk at:#SourceCodeManager) notNil ifTrue:[ |
166 (mgr := Smalltalk at:#SourceCodeManager) notNil ifTrue:[ |
167 classFileName := Smalltalk fileNameForClass:myName. |
167 classFileName := Smalltalk fileNameForClass:myName. |
168 packageDir := Smalltalk sourceDirectoryNameOfClass:myName. |
168 packageDir := Smalltalk sourceDirectoryNameOfClass:myName. |
169 ]. |
169 ]. |
170 (classFileName notNil and:[packageDir notNil]) ifTrue:[ |
170 (classFileName notNil and:[packageDir notNil]) ifTrue:[ |
171 aStream nextPutAll:'When accessed, I''ll ask the sourceCodeManager to load the code |
171 aStream nextPutAll:'When accessed, I''ll ask the sourceCodeManager to load the code |
172 from "' , classFileName , '.st" in the "' , packageDir , '" package.'. |
172 from "' , classFileName , '.st" in the "' , packageDir , '" package.'. |
173 ] ifFalse:[ |
173 ] ifFalse:[ |
174 aStream nextPutAll:'When accessed, an error will be reported.'. |
174 aStream nextPutAll:'When accessed, an error will be reported.'. |
175 ] |
175 ] |
176 ]. |
176 ]. |
177 aStream cr; nextPutAll:'"'. |
177 aStream cr; nextPutAll:'"'. |
178 |
178 |
179 "Created: 8.12.1995 / 00:31:53 / cg" |
179 "Created: 8.12.1995 / 00:31:53 / cg" |
180 "Modified: 9.12.1995 / 22:31:02 / cg" |
180 "Modified: 9.12.1995 / 22:31:02 / cg" |