Autoload.st
author Claus Gittinger <cg@exept.de>
Mon, 10 Feb 1997 13:20:50 +0100
changeset 2375 7eb1b35edc33
parent 2366 bbe8c60d7c9f
child 2531 1e22ac3610a4
permissions -rw-r--r--
autoload into Smalltalk nameSpace - by default.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     1
"
5
67342904af11 *** empty log message ***
claus
parents: 3
diff changeset
     2
 COPYRIGHT (c) 1991 by Claus Gittinger
154
d4236ec280a6 *** empty log message ***
claus
parents: 138
diff changeset
     3
	      All Rights Reserved
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     4
a27a279701f8 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
a27a279701f8 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
a27a279701f8 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
a27a279701f8 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
a27a279701f8 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
a27a279701f8 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
a27a279701f8 Initial revision
claus
parents:
diff changeset
    11
"
a27a279701f8 Initial revision
claus
parents:
diff changeset
    12
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
    13
nil subclass:#Autoload
938
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
    14
	instanceVariableNames:''
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
    15
	classVariableNames:'LazyLoading AutoloadFailedSignal LoadedClasses'
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
    16
	poolDictionaries:''
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
    17
	category:'Kernel-Classes'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    18
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    19
1862
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
    20
!Autoload class methodsFor:'documentation'!
68
59faa75185ba *** empty log message ***
claus
parents: 22
diff changeset
    21
88
81dacba7a63a *** empty log message ***
claus
parents: 68
diff changeset
    22
copyright
81dacba7a63a *** empty log message ***
claus
parents: 68
diff changeset
    23
"
81dacba7a63a *** empty log message ***
claus
parents: 68
diff changeset
    24
 COPYRIGHT (c) 1991 by Claus Gittinger
154
d4236ec280a6 *** empty log message ***
claus
parents: 138
diff changeset
    25
	      All Rights Reserved
88
81dacba7a63a *** empty log message ***
claus
parents: 68
diff changeset
    26
81dacba7a63a *** empty log message ***
claus
parents: 68
diff changeset
    27
 This software is furnished under a license and may be used
81dacba7a63a *** empty log message ***
claus
parents: 68
diff changeset
    28
 only in accordance with the terms of that license and with the
81dacba7a63a *** empty log message ***
claus
parents: 68
diff changeset
    29
 inclusion of the above copyright notice.   This software may not
81dacba7a63a *** empty log message ***
claus
parents: 68
diff changeset
    30
 be provided or otherwise made available to, or used by, any
81dacba7a63a *** empty log message ***
claus
parents: 68
diff changeset
    31
 other person.  No title to or ownership of the software is
81dacba7a63a *** empty log message ***
claus
parents: 68
diff changeset
    32
 hereby transferred.
81dacba7a63a *** empty log message ***
claus
parents: 68
diff changeset
    33
"
81dacba7a63a *** empty log message ***
claus
parents: 68
diff changeset
    34
!
81dacba7a63a *** empty log message ***
claus
parents: 68
diff changeset
    35
68
59faa75185ba *** empty log message ***
claus
parents: 22
diff changeset
    36
documentation
59faa75185ba *** empty log message ***
claus
parents: 22
diff changeset
    37
"
59faa75185ba *** empty log message ***
claus
parents: 22
diff changeset
    38
    In memory limited systems (as my 8Mb 386 is) all seldom-used classes are made
59faa75185ba *** empty log message ***
claus
parents: 22
diff changeset
    39
    subclasses of this class. Autoload catches all messages and
59faa75185ba *** empty log message ***
claus
parents: 22
diff changeset
    40
    files-In the corresponding code when first used. Then the cought message
59faa75185ba *** empty log message ***
claus
parents: 22
diff changeset
    41
    is resent to the (now existing) class.
59faa75185ba *** empty log message ***
claus
parents: 22
diff changeset
    42
59faa75185ba *** empty log message ***
claus
parents: 22
diff changeset
    43
    Late addition: above comment is no longer true - I have made now almost
59faa75185ba *** empty log message ***
claus
parents: 22
diff changeset
    44
    all Demos & Goodies be autoloaded ... even for big systems.
59faa75185ba *** empty log message ***
claus
parents: 22
diff changeset
    45
1278
7ef5a312d87e commentary
Claus Gittinger <cg@exept.de>
parents: 1277
diff changeset
    46
    [class variables:]
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
    47
        
1278
7ef5a312d87e commentary
Claus Gittinger <cg@exept.de>
parents: 1277
diff changeset
    48
        LazyLoading             <Boolean>       if true, the loaded classes 
7ef5a312d87e commentary
Claus Gittinger <cg@exept.de>
parents: 1277
diff changeset
    49
                                                methods will NOT be compiled at 
7ef5a312d87e commentary
Claus Gittinger <cg@exept.de>
parents: 1277
diff changeset
    50
                                                autoload time, but instead when 
7ef5a312d87e commentary
Claus Gittinger <cg@exept.de>
parents: 1277
diff changeset
    51
                                                first called. This allows for a 
7ef5a312d87e commentary
Claus Gittinger <cg@exept.de>
parents: 1277
diff changeset
    52
                                                faster load. However, expect short 
7ef5a312d87e commentary
Claus Gittinger <cg@exept.de>
parents: 1277
diff changeset
    53
                                                pauses later when the methods are
7ef5a312d87e commentary
Claus Gittinger <cg@exept.de>
parents: 1277
diff changeset
    54
                                                first executed.
126
c00c6e25c98c raise a signal on failure
claus
parents: 92
diff changeset
    55
                                     
1278
7ef5a312d87e commentary
Claus Gittinger <cg@exept.de>
parents: 1277
diff changeset
    56
        AutoloadFailedSignal    <Signal>        signal raised if an autoloaded 
7ef5a312d87e commentary
Claus Gittinger <cg@exept.de>
parents: 1277
diff changeset
    57
                                                classes source is not available.
922
0e8e0d920d0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 921
diff changeset
    58
1278
7ef5a312d87e commentary
Claus Gittinger <cg@exept.de>
parents: 1277
diff changeset
    59
        LoadedClasses           <Collection>    set of classes that heve been
7ef5a312d87e commentary
Claus Gittinger <cg@exept.de>
parents: 1277
diff changeset
    60
                                                autoloaded (for later unload)
1292
89497fff7f87 documentation
Claus Gittinger <cg@exept.de>
parents: 1278
diff changeset
    61
89497fff7f87 documentation
Claus Gittinger <cg@exept.de>
parents: 1278
diff changeset
    62
    [author:]
89497fff7f87 documentation
Claus Gittinger <cg@exept.de>
parents: 1278
diff changeset
    63
        Claus Gittinger
68
59faa75185ba *** empty log message ***
claus
parents: 22
diff changeset
    64
"
59faa75185ba *** empty log message ***
claus
parents: 22
diff changeset
    65
! !
59faa75185ba *** empty log message ***
claus
parents: 22
diff changeset
    66
1862
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
    67
!Autoload class methodsFor:'initialization'!
126
c00c6e25c98c raise a signal on failure
claus
parents: 92
diff changeset
    68
c00c6e25c98c raise a signal on failure
claus
parents: 92
diff changeset
    69
initialize
2223
87381a043e75 commentary
Claus Gittinger <cg@exept.de>
parents: 2112
diff changeset
    70
    "initialize the failure-signal"
87381a043e75 commentary
Claus Gittinger <cg@exept.de>
parents: 2112
diff changeset
    71
126
c00c6e25c98c raise a signal on failure
claus
parents: 92
diff changeset
    72
    AutoloadFailedSignal isNil ifTrue:[
2223
87381a043e75 commentary
Claus Gittinger <cg@exept.de>
parents: 2112
diff changeset
    73
        AutoloadFailedSignal := Object errorSignal newSignalMayProceed:true.
87381a043e75 commentary
Claus Gittinger <cg@exept.de>
parents: 2112
diff changeset
    74
        AutoloadFailedSignal nameClass:self message:#autoloadFailedSignal.
87381a043e75 commentary
Claus Gittinger <cg@exept.de>
parents: 2112
diff changeset
    75
        AutoloadFailedSignal notifierString:'autoload failed '.
197
    76
2223
87381a043e75 commentary
Claus Gittinger <cg@exept.de>
parents: 2112
diff changeset
    77
        self setSuperclass:nil.
87381a043e75 commentary
Claus Gittinger <cg@exept.de>
parents: 2112
diff changeset
    78
        ObjectMemory flushCaches.
126
c00c6e25c98c raise a signal on failure
claus
parents: 92
diff changeset
    79
    ]
2223
87381a043e75 commentary
Claus Gittinger <cg@exept.de>
parents: 2112
diff changeset
    80
87381a043e75 commentary
Claus Gittinger <cg@exept.de>
parents: 2112
diff changeset
    81
    "Modified: 22.1.1997 / 18:35:44 / cg"
126
c00c6e25c98c raise a signal on failure
claus
parents: 92
diff changeset
    82
! !
c00c6e25c98c raise a signal on failure
claus
parents: 92
diff changeset
    83
1862
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
    84
!Autoload class methodsFor:'Signal constants'!
126
c00c6e25c98c raise a signal on failure
claus
parents: 92
diff changeset
    85
c00c6e25c98c raise a signal on failure
claus
parents: 92
diff changeset
    86
autoloadFailedSignal
c00c6e25c98c raise a signal on failure
claus
parents: 92
diff changeset
    87
    "return the signal raised when an autoload fails"
c00c6e25c98c raise a signal on failure
claus
parents: 92
diff changeset
    88
c00c6e25c98c raise a signal on failure
claus
parents: 92
diff changeset
    89
    ^ AutoloadFailedSignal
c00c6e25c98c raise a signal on failure
claus
parents: 92
diff changeset
    90
! !
c00c6e25c98c raise a signal on failure
claus
parents: 92
diff changeset
    91
1862
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
    92
!Autoload class methodsFor:'adding/removing autoloaded classes'!
359
claus
parents: 356
diff changeset
    93
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
    94
addClass:aClassName
1277
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    95
    "given a name, install a corresponding autoload class stub for it"
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    96
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
    97
    self addClass:aClassName inCategory:'autoloaded-Classes'
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
    98
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
    99
    "
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   100
     Autoload addClass:'Clock'
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   101
    "
1277
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   102
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   103
    "Modified: 24.4.1996 / 19:54:16 / cg"
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   104
!
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   105
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   106
addClass:aClassName inCategory:aCategory
1277
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   107
    "given a name, install a corresponding autoload class stub for it"
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   108
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   109
    |nameSymbol|
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   110
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   111
    nameSymbol := aClassName asSymbol.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   112
    (Smalltalk at:nameSymbol) isNil ifTrue:[
1277
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   113
        Autoload subclass:nameSymbol
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   114
             instanceVariableNames:''
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   115
             classVariableNames:''
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   116
             poolDictionaries:''
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   117
             category:aCategory.
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   118
    ]
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   119
    "
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   120
     Autoload addClass:'Clock' inCategory:'autoloaded-Demos'
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   121
    "
1277
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   122
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   123
    "Modified: 24.4.1996 / 19:54:20 / cg"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   124
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   125
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   126
removeClass:aClass
1277
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   127
    "remove a class from the list of loaded classes"
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   128
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   129
    LoadedClasses remove:aClass ifAbsent:[]
1277
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   130
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   131
    "Modified: 24.4.1996 / 19:54:35 / cg"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   132
! !
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   133
1862
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   134
!Autoload class methodsFor:'fileout'!
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   135
2067
36226285e85e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2062
diff changeset
   136
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   137
    "print an expression to define myself on aStream.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   138
     Since autoloaded classes dont know their real definition, simply
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   139
     output some comment string making things clear in the browser."
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   140
709
c31cbd5e5323 more info for autoloaded classes (for browsers definition text)
Claus Gittinger <cg@exept.de>
parents: 661
diff changeset
   141
    |myName fileName nm mgr classFileName packageDir|
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   142
2067
36226285e85e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2062
diff changeset
   143
    (self == Autoload) ifTrue:[^ super basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace].
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   144
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   145
    myName := self name.
1952
18cfc11b49fa use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1862
diff changeset
   146
    aStream nextPutAll:'"' ; nextPutLine:'Notice from Autoload:'; cr;
18cfc11b49fa use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1862
diff changeset
   147
            spaces:4; nextPutLine:myName , ' is not yet loaded.'; cr.
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   148
    aStream nextPutAll:'to load, execute: '.
1952
18cfc11b49fa use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1862
diff changeset
   149
    aStream cr; cr; spaces:4; nextPutLine:myName  , ' autoload'.
2019
8f44b270809b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
   150
    aStream cr; nextPutLine:'or use the browsers load-function (in the class menu).'.
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   151
    "
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   152
     the following is simply informative ...
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   153
     actually, its a hack & kludge - there ought to be a method for this
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   154
     in Smalltalk 
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   155
     (knowing the details of loading here is no good coding style)
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   156
    "
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   157
    fileName := Smalltalk fileNameForClass:myName.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   158
    (ObjectFileLoader notNil and:[Smalltalk loadBinaries]) ifTrue:[
1862
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   159
        (nm := Smalltalk libraryFileNameOfClass:myName) notNil ifTrue:[
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   160
            nm := nm , ' (a classLibrary, possibly including more classes)'
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   161
        ] ifFalse:[
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   162
            nm := Smalltalk getBinaryFileName:(fileName , '.so').
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   163
            nm isNil ifTrue:[
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   164
                nm := Smalltalk getBinaryFileName:(fileName , '.o')
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   165
            ].
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   166
            nm notNil ifTrue:[
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   167
                nm := nm , ' (a classBinary)'
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   168
            ]
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   169
        ].
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   170
    ].
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   171
    nm isNil ifTrue:[
1862
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   172
        nm := Smalltalk getFileInFileName:(fileName , '.st').
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   173
        nm isNil ifTrue:[
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   174
            nm := Smalltalk getSourceFileName:(fileName , '.st').
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   175
        ].
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   176
    ].
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   177
    nm notNil ifTrue:[
1952
18cfc11b49fa use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1862
diff changeset
   178
        aStream cr; nextPutLine:'When accessed, ' , myName , ' will automatically be loaded'.
18cfc11b49fa use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1862
diff changeset
   179
        aStream nextPutLine:'from: '; spaces:4; nextPutAll:nm.
1862
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   180
        nm asFilename isSymbolicLink ifTrue:[
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   181
            aStream cr; cr.
1952
18cfc11b49fa use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1862
diff changeset
   182
            aStream nextPutLine:'which is a link to: '; spaces:4; 
1862
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   183
                    nextPutAll:(nm asFilename linkInfo path).
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   184
        ]
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   185
    ] ifFalse:[
1952
18cfc11b49fa use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1862
diff changeset
   186
        aStream cr; nextPutLine:'There is currently no file to load ' , myName , ' from.'; cr.
709
c31cbd5e5323 more info for autoloaded classes (for browsers definition text)
Claus Gittinger <cg@exept.de>
parents: 661
diff changeset
   187
1862
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   188
        (mgr := Smalltalk at:#SourceCodeManager) notNil ifTrue:[
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   189
            classFileName := Smalltalk fileNameForClass:myName.
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   190
            packageDir := Smalltalk sourceDirectoryNameOfClass:myName.
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   191
        ].
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   192
        (classFileName notNil and:[packageDir notNil]) ifTrue:[
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   193
            aStream nextPutAll:'When accessed, I''ll ask the sourceCodeManager to load the code 
709
c31cbd5e5323 more info for autoloaded classes (for browsers definition text)
Claus Gittinger <cg@exept.de>
parents: 661
diff changeset
   194
from "' , classFileName , '.st" in the "' , packageDir , '" package.'.
1862
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   195
        ] ifFalse:[
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   196
            aStream nextPutAll:'When accessed, an error will be reported.'.
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   197
        ]
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   198
    ].
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   199
    aStream cr; nextPutAll:'"'.
709
c31cbd5e5323 more info for autoloaded classes (for browsers definition text)
Claus Gittinger <cg@exept.de>
parents: 661
diff changeset
   200
2019
8f44b270809b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
   201
    "Modified: 30.12.1996 / 17:25:15 / cg"
2067
36226285e85e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2062
diff changeset
   202
    "Created: 5.1.1997 / 14:31:33 / cg"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   203
! !
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   204
1862
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   205
!Autoload class methodsFor:'lazy compilation'!
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   206
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   207
compileLazy
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   208
    "return the lazy loading flag - if on, fileIn is much faster,
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   209
     but pauses are to be expected later, since methods are compiled
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   210
     when first executed."
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   211
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   212
    ^ LazyLoading
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   213
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   214
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   215
compileLazy:aBoolean
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   216
    "turn on/off lazy loading - if on, fileIn is much faster,
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   217
     but pauses are to be expected later, since methods are compiled
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   218
     when first executed.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   219
     If you like it, add a line to your startup file."
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   220
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   221
    LazyLoading := aBoolean
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   222
! !
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   223
1862
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   224
!Autoload class methodsFor:'loading'!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   225
a27a279701f8 Initial revision
claus
parents:
diff changeset
   226
autoload
a27a279701f8 Initial revision
claus
parents:
diff changeset
   227
    "use this to force loading
2062
762e951d42b8 #initialize
Claus Gittinger <cg@exept.de>
parents: 2061
diff changeset
   228
     - it is defined a noop in all non-autoloading classes"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   229
2061
d6f224b06999 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2057
diff changeset
   230
    |mySelf myName newClass oldMeta project prevMode package|
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   231
a27a279701f8 Initial revision
claus
parents:
diff changeset
   232
    mySelf := self.
164
9bad8fe706e9 *** empty log message ***
claus
parents: 154
diff changeset
   233
    myName := self name asSymbol.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   234
a27a279701f8 Initial revision
claus
parents:
diff changeset
   235
    "remove myself - to avoid recompilation"
164
9bad8fe706e9 *** empty log message ***
claus
parents: 154
diff changeset
   236
    Smalltalk at:myName put:nil.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   237
2
claus
parents: 1
diff changeset
   238
    "load it"
1566
b1968c0d02bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1564
diff changeset
   239
    (Object infoPrinting and:[Smalltalk silentLoading ~~ true]) ifTrue:[
1564
f3f9736bd0fa suppress load messages, if infoPrinting is turned off
Claus Gittinger <cg@exept.de>
parents: 1438
diff changeset
   240
        Transcript showCR:('autoloading ', myName , ' ...'); endEntry.
f3f9736bd0fa suppress load messages, if infoPrinting is turned off
Claus Gittinger <cg@exept.de>
parents: 1438
diff changeset
   241
    ].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   242
860
b3ffea40999a use new becomeSameAs: to migrate to new class.
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   243
    [
1694
29791fde790e autoload classes keep source reference
Claus Gittinger <cg@exept.de>
parents: 1674
diff changeset
   244
        prevMode := ClassCategoryReader sourceMode.
1720
831096ab21a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
   245
"/
831096ab21a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
   246
"/ no- do not do this; it may lead to trouble ...
831096ab21a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1694
diff changeset
   247
"/        ClassCategoryReader sourceMode:#reference.
1694
29791fde790e autoload classes keep source reference
Claus Gittinger <cg@exept.de>
parents: 1674
diff changeset
   248
938
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   249
        "/
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   250
        "/ in order to not get a package of private (or whatever),
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   251
        "/ temporarily set the currentProject to nil.
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   252
        "/ we will later set the classes package to something useful
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   253
        "/
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   254
        Project notNil ifTrue:[
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   255
            project := Project current.
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   256
            Project setProject:nil.
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   257
        ].
2375
7eb1b35edc33 autoload into Smalltalk nameSpace - by default.
Claus Gittinger <cg@exept.de>
parents: 2366
diff changeset
   258
7eb1b35edc33 autoload into Smalltalk nameSpace - by default.
Claus Gittinger <cg@exept.de>
parents: 2366
diff changeset
   259
        Class nameSpaceQuerySignal answer:Smalltalk 
7eb1b35edc33 autoload into Smalltalk nameSpace - by default.
Claus Gittinger <cg@exept.de>
parents: 2366
diff changeset
   260
        do:[
7eb1b35edc33 autoload into Smalltalk nameSpace - by default.
Claus Gittinger <cg@exept.de>
parents: 2366
diff changeset
   261
            Smalltalk fileInClass:myName initialize:false lazy:LazyLoading.
7eb1b35edc33 autoload into Smalltalk nameSpace - by default.
Claus Gittinger <cg@exept.de>
parents: 2366
diff changeset
   262
        ].
1694
29791fde790e autoload classes keep source reference
Claus Gittinger <cg@exept.de>
parents: 1674
diff changeset
   263
        ClassCategoryReader sourceMode:prevMode.
938
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   264
        project notNil ifTrue:[
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   265
            Project setProject:project.
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   266
        ].
860
b3ffea40999a use new becomeSameAs: to migrate to new class.
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   267
    ] valueOnUnwindDo:[
1694
29791fde790e autoload classes keep source reference
Claus Gittinger <cg@exept.de>
parents: 1674
diff changeset
   268
        ClassCategoryReader sourceMode:prevMode.
938
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   269
        project notNil ifTrue:[
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   270
            Project setProject:project.
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   271
        ].
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   272
        Smalltalk at:myName put:mySelf.
860
b3ffea40999a use new becomeSameAs: to migrate to new class.
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   273
    ].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   274
a27a279701f8 Initial revision
claus
parents:
diff changeset
   275
    "did it work ?"
164
9bad8fe706e9 *** empty log message ***
claus
parents: 154
diff changeset
   276
    newClass := Smalltalk at:myName.
9bad8fe706e9 *** empty log message ***
claus
parents: 154
diff changeset
   277
    Smalltalk at:myName put:mySelf.   "will be undone by become:"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   278
138
c9f46b635f98 *** empty log message ***
claus
parents: 126
diff changeset
   279
    "no - report the error"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   280
    newClass isNil ifTrue:[
938
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   281
        "
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   282
         this signal is raised, if an autoloaded class
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   283
         cannot be loaded. Usually, this happends when
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   284
         some sourcefile is missing, not readable or if 
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   285
         an entry is missing in the abbreviation file.
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   286
         Check for a readable file named <myName>.st 
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   287
         in the 'source' directory and (if its a long fileName) 
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   288
         for a corresponding entry in the abbreviation file
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   289
         'include/abbrev.stc'.
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   290
         Finally, your searchpath could be set wrong -
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   291
         both 'source' and 'include' directories must be found in
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   292
         one of the directories named in systemPath.
154
d4236ec280a6 *** empty log message ***
claus
parents: 138
diff changeset
   293
938
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   294
         In the debugger, press 'abort' to continue execution.
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   295
        " 
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   296
        AutoloadFailedSignal
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   297
            raiseRequestWith:self
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   298
            errorString:('autoload of ' , myName , ' failed').
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   299
        ^ nil
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   300
    ].
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   301
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   302
    "/
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   303
    "/ autoloaded classes get their package from the revision (if present)
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   304
    "/ this only happens with autoloaded sourceFiles which have no package
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   305
    "/ info encoded. (binary classes have it)
2057
35003ed4b817 care for the package ID when autoloading
Claus Gittinger <cg@exept.de>
parents: 2019
diff changeset
   306
    "/ If there is no such information, give it my package (if I have one)
938
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   307
    "/
2057
35003ed4b817 care for the package ID when autoloading
Claus Gittinger <cg@exept.de>
parents: 2019
diff changeset
   308
    newClass setPackageFromRevision.
35003ed4b817 care for the package ID when autoloading
Claus Gittinger <cg@exept.de>
parents: 2019
diff changeset
   309
    (newClass package isNil 
35003ed4b817 care for the package ID when autoloading
Claus Gittinger <cg@exept.de>
parents: 2019
diff changeset
   310
    or:[newClass package = 'no package']) ifTrue:[
2112
a5cff76f7404 only #initialize if the class itself implements it
Claus Gittinger <cg@exept.de>
parents: 2067
diff changeset
   311
        package := self package.
2057
35003ed4b817 care for the package ID when autoloading
Claus Gittinger <cg@exept.de>
parents: 2019
diff changeset
   312
        (package notNil and:[package ~= 'no package'])
35003ed4b817 care for the package ID when autoloading
Claus Gittinger <cg@exept.de>
parents: 2019
diff changeset
   313
        ifTrue:[
35003ed4b817 care for the package ID when autoloading
Claus Gittinger <cg@exept.de>
parents: 2019
diff changeset
   314
            newClass setPackage:package.
35003ed4b817 care for the package ID when autoloading
Claus Gittinger <cg@exept.de>
parents: 2019
diff changeset
   315
        ].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   316
    ].
a27a279701f8 Initial revision
claus
parents:
diff changeset
   317
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   318
    LoadedClasses isNil ifTrue:[
938
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   319
        LoadedClasses := IdentitySet new.
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   320
    ].
921
4db7603f9506 rename myself (just in case) & flush caches after loading
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   321
    LoadedClasses add:newClass.
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   322
154
d4236ec280a6 *** empty log message ***
claus
parents: 138
diff changeset
   323
    "wow - it worked. now the big trick ..."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   324
921
4db7603f9506 rename myself (just in case) & flush caches after loading
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   325
"/    newClass class setSoleInstance:self.   "/ will be undone by become ...
4db7603f9506 rename myself (just in case) & flush caches after loading
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   326
    oldMeta := self class.
4db7603f9506 rename myself (just in case) & flush caches after loading
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   327
4db7603f9506 rename myself (just in case) & flush caches after loading
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   328
self setName:(self name , ' (auto)').
4db7603f9506 rename myself (just in case) & flush caches after loading
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   329
self class setName:(self class name , ' (auto)').
4db7603f9506 rename myself (just in case) & flush caches after loading
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   330
860
b3ffea40999a use new becomeSameAs: to migrate to new class.
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   331
    self becomeSameAs:newClass.
921
4db7603f9506 rename myself (just in case) & flush caches after loading
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   332
    oldMeta becomeSameAs:newClass class.
4db7603f9506 rename myself (just in case) & flush caches after loading
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   333
4db7603f9506 rename myself (just in case) & flush caches after loading
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   334
    ObjectMemory flushCaches.
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   335
    LoadedClasses rehash.
921
4db7603f9506 rename myself (just in case) & flush caches after loading
Claus Gittinger <cg@exept.de>
parents: 886
diff changeset
   336
2112
a5cff76f7404 only #initialize if the class itself implements it
Claus Gittinger <cg@exept.de>
parents: 2067
diff changeset
   337
    (newClass class implements:#initialize) ifTrue:[
1148
9f69b4df970b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 938
diff changeset
   338
        newClass initialize.
9f69b4df970b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 938
diff changeset
   339
    ].
886
62c66d49077d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 860
diff changeset
   340
    newClass postAutoload.
62c66d49077d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 860
diff changeset
   341
    ^ newClass
938
a23bc7f62ed1 set package info when autoloading
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   342
2375
7eb1b35edc33 autoload into Smalltalk nameSpace - by default.
Claus Gittinger <cg@exept.de>
parents: 2366
diff changeset
   343
    "Modified: 7.2.1997 / 13:34:19 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   344
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   345
1862
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   346
!Autoload class methodsFor:'message catching'!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   347
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   348
basicNew
1277
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   349
    "catch basicNew - load the class and send it to the real one"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   350
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   351
    ^ self doesNotUnderstand:(Message selector:#basicNew)
1277
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   352
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   353
    "Modified: 24.4.1996 / 19:53:10 / cg"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   354
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   355
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   356
basicNew:arg
1277
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   357
    "catch basicNew: - load the class and send it to the real one"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   358
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   359
    ^ self doesNotUnderstand:(Message selector:#basicNew: with:arg)
1277
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   360
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   361
    "Modified: 24.4.1996 / 19:53:16 / cg"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   362
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   363
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   364
comment
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   365
    "return the classes comment.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   366
     Autoloaded classes have no comment; but I myself have one"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   367
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   368
    (self == Autoload) ifTrue:[^ super comment].
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   369
    ^ 'not yet loaded'
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   370
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   371
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   372
doesNotUnderstand:aMessage
1277
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   373
    "cought a message; load the class and retry the message"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   374
a27a279701f8 Initial revision
claus
parents:
diff changeset
   375
    |newClass|
a27a279701f8 Initial revision
claus
parents:
diff changeset
   376
164
9bad8fe706e9 *** empty log message ***
claus
parents: 154
diff changeset
   377
    self ~~ Autoload ifTrue:[
1277
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   378
        newClass := self autoload.
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   379
        newClass notNil ifTrue:[
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   380
            ^ newClass perform:(aMessage selector)
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   381
                 withArguments:(aMessage arguments)
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   382
        ]
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   383
    ].
789
155eca125ef0 return value from doesNotUnderstand (so handler can return a value)
Claus Gittinger <cg@exept.de>
parents: 739
diff changeset
   384
    ^ super doesNotUnderstand:aMessage
1277
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   385
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   386
    "Modified: 24.4.1996 / 19:53:27 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   387
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   388
a27a279701f8 Initial revision
claus
parents:
diff changeset
   389
new
1277
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   390
    "catch new - load the class and send it to the real one"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   391
a27a279701f8 Initial revision
claus
parents:
diff changeset
   392
    ^ self doesNotUnderstand:(Message selector:#new)
1277
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   393
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   394
    "Modified: 24.4.1996 / 19:53:30 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   395
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   396
a27a279701f8 Initial revision
claus
parents:
diff changeset
   397
new:arg
1277
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   398
    "catch new: - load the class and send it to the real one"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   399
a27a279701f8 Initial revision
claus
parents:
diff changeset
   400
    ^ self doesNotUnderstand:(Message selector:#new: with:arg)
1277
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   401
7acd342fb251 commentary
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   402
    "Modified: 24.4.1996 / 19:53:32 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   403
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   404
1438
76fdecf85f9e Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents: 1437
diff changeset
   405
readFrom:aStream 
76fdecf85f9e Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents: 1437
diff changeset
   406
    "catch  - load the class and send it to the real one"
76fdecf85f9e Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents: 1437
diff changeset
   407
76fdecf85f9e Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents: 1437
diff changeset
   408
    ^ self doesNotUnderstand:(Message selector:#readFrom: with:aStream)
76fdecf85f9e Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents: 1437
diff changeset
   409
76fdecf85f9e Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents: 1437
diff changeset
   410
    "Created: 22.5.1996 / 23:44:23 / stefan"
76fdecf85f9e Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents: 1437
diff changeset
   411
!
76fdecf85f9e Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents: 1437
diff changeset
   412
1437
2a167c1f9f35 Catch readFrom:onError et al.
Stefan Vogel <sv@exept.de>
parents: 1414
diff changeset
   413
readFrom:aStream onError:exceptionBlock
2a167c1f9f35 Catch readFrom:onError et al.
Stefan Vogel <sv@exept.de>
parents: 1414
diff changeset
   414
    "catch  - load the class and send it to the real one"
2a167c1f9f35 Catch readFrom:onError et al.
Stefan Vogel <sv@exept.de>
parents: 1414
diff changeset
   415
2a167c1f9f35 Catch readFrom:onError et al.
Stefan Vogel <sv@exept.de>
parents: 1414
diff changeset
   416
    ^ self doesNotUnderstand:(Message selector:#readFrom:onError: with:aStream with:exceptionBlock)
2a167c1f9f35 Catch readFrom:onError et al.
Stefan Vogel <sv@exept.de>
parents: 1414
diff changeset
   417
2a167c1f9f35 Catch readFrom:onError et al.
Stefan Vogel <sv@exept.de>
parents: 1414
diff changeset
   418
    "Created: 22.5.1996 / 23:03:39 / stefan"
2a167c1f9f35 Catch readFrom:onError et al.
Stefan Vogel <sv@exept.de>
parents: 1414
diff changeset
   419
!
2a167c1f9f35 Catch readFrom:onError et al.
Stefan Vogel <sv@exept.de>
parents: 1414
diff changeset
   420
1438
76fdecf85f9e Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents: 1437
diff changeset
   421
readFromString:aString
76fdecf85f9e Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents: 1437
diff changeset
   422
    "catch  - load the class and send it to the real one"
76fdecf85f9e Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents: 1437
diff changeset
   423
76fdecf85f9e Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents: 1437
diff changeset
   424
    ^ self doesNotUnderstand:(Message selector:#readFromString: with:aString)
76fdecf85f9e Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents: 1437
diff changeset
   425
76fdecf85f9e Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents: 1437
diff changeset
   426
    "Created: 22.5.1996 / 23:46:15 / stefan"
76fdecf85f9e Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents: 1437
diff changeset
   427
!
76fdecf85f9e Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents: 1437
diff changeset
   428
1437
2a167c1f9f35 Catch readFrom:onError et al.
Stefan Vogel <sv@exept.de>
parents: 1414
diff changeset
   429
readFromString:aString onError:exceptionBlock
2a167c1f9f35 Catch readFrom:onError et al.
Stefan Vogel <sv@exept.de>
parents: 1414
diff changeset
   430
    "catch  - load the class and send it to the real one"
2a167c1f9f35 Catch readFrom:onError et al.
Stefan Vogel <sv@exept.de>
parents: 1414
diff changeset
   431
2a167c1f9f35 Catch readFrom:onError et al.
Stefan Vogel <sv@exept.de>
parents: 1414
diff changeset
   432
    ^ self doesNotUnderstand:(Message selector:#readFromString:onError: with:aString with:exceptionBlock)
2a167c1f9f35 Catch readFrom:onError et al.
Stefan Vogel <sv@exept.de>
parents: 1414
diff changeset
   433
2a167c1f9f35 Catch readFrom:onError et al.
Stefan Vogel <sv@exept.de>
parents: 1414
diff changeset
   434
    "Created: 22.5.1996 / 23:04:49 / stefan"
2a167c1f9f35 Catch readFrom:onError et al.
Stefan Vogel <sv@exept.de>
parents: 1414
diff changeset
   435
!
2a167c1f9f35 Catch readFrom:onError et al.
Stefan Vogel <sv@exept.de>
parents: 1414
diff changeset
   436
2366
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   437
subclass:nameSymbol instanceVariableNames:instVarNames classVariableNames:cVarNames poolDictionaries:pools category:cat
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   438
    "catch subclass creation - this forces missing superclasses to be 
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   439
     loaded first"
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   440
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   441
    ^ self
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   442
        subclass:nameSymbol     
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   443
        instanceVariableNames:instVarNames 
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   444
        classVariableNames:cVarNames 
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   445
        poolDictionaries:pools 
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   446
        category:cat
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   447
        inEnvironment:(Class nameSpaceQuerySignal raise)
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   448
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   449
    "Modified: 8.2.1997 / 20:06:22 / cg"
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   450
!
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   451
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   452
subclass:nameSymbol instanceVariableNames:instVarNames classVariableNames:cVarNames poolDictionaries:poolDicts category:cat inEnvironment:aNameSpace
2
claus
parents: 1
diff changeset
   453
    "catch subclass creation - this forces missing superclasses to be 
claus
parents: 1
diff changeset
   454
     loaded first"
claus
parents: 1
diff changeset
   455
68
59faa75185ba *** empty log message ***
claus
parents: 22
diff changeset
   456
    |newClass sel args|
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   457
2
claus
parents: 1
diff changeset
   458
    "take care: subclassing Autoload must still be possible"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   459
    (self == Autoload) ifTrue:[
2366
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   460
        ^ super 
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   461
            subclass:nameSymbol 
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   462
            instanceVariableNames:instVarNames
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   463
            classVariableNames:cVarNames
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   464
            poolDictionaries:poolDicts
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   465
            category:cat
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   466
            inEnvironment:aNameSpace
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   467
    ].
2366
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   468
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   469
    newClass := self autoload.
68
59faa75185ba *** empty log message ***
claus
parents: 22
diff changeset
   470
    sel := thisContext selector.
59faa75185ba *** empty log message ***
claus
parents: 22
diff changeset
   471
    args := thisContext args.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   472
    newClass notNil ifTrue:[
2366
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   473
        ^ newClass perform:sel withArguments:args
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   474
    ].
a27a279701f8 Initial revision
claus
parents:
diff changeset
   475
    ^ nil
2366
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   476
bbe8c60d7c9f additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents: 2223
diff changeset
   477
    "Created: 8.2.1997 / 19:42:47 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   478
! !
11
6bf3080856be *** empty log message ***
claus
parents: 5
diff changeset
   479
1862
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   480
!Autoload class methodsFor:'queries'!
356
claus
parents: 345
diff changeset
   481
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   482
isBehavior
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   483
    "return true if the recevier is some kind of class.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   484
     Autoloaded classes are definitely; therefore return true."
164
9bad8fe706e9 *** empty log message ***
claus
parents: 154
diff changeset
   485
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   486
    ^ true
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   487
!
356
claus
parents: 345
diff changeset
   488
729
67a60a088d56 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   489
isBuiltInClass
1266
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1148
diff changeset
   490
    "return true if this class is known by the run-time-system.
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1148
diff changeset
   491
     Returns false here."
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1148
diff changeset
   492
729
67a60a088d56 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   493
    ^ false
67a60a088d56 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   494
67a60a088d56 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   495
    "Created: 10.12.1995 / 00:28:22 / cg"
1266
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1148
diff changeset
   496
    "Modified: 23.4.1996 / 15:55:36 / cg"
729
67a60a088d56 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   497
!
67a60a088d56 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   498
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   499
isLoaded
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   500
    "return true, if the class has been loaded; redefined in Autoload;
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   501
     see comment there. this allows testing for a class been already loaded."
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   502
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   503
    ^ (self == Autoload)
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   504
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   505
922
0e8e0d920d0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 921
diff changeset
   506
loadedClasses
0e8e0d920d0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 921
diff changeset
   507
    "return the set of classes that were autoloaded"
0e8e0d920d0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 921
diff changeset
   508
0e8e0d920d0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 921
diff changeset
   509
    ^ LoadedClasses
0e8e0d920d0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 921
diff changeset
   510
!
0e8e0d920d0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 921
diff changeset
   511
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   512
wasAutoloaded:aClass
922
0e8e0d920d0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 921
diff changeset
   513
    "return true, if aClass was autoloaded"
0e8e0d920d0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 921
diff changeset
   514
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   515
    ^ LoadedClasses notNil and:[LoadedClasses includes:aClass]
11
6bf3080856be *** empty log message ***
claus
parents: 5
diff changeset
   516
! !
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   517
1862
e8f44f10f1ab changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents: 1720
diff changeset
   518
!Autoload class methodsFor:'documentation'!
661
7e1c7358c980 version method at the end
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   519
7e1c7358c980 version method at the end
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   520
version
2375
7eb1b35edc33 autoload into Smalltalk nameSpace - by default.
Claus Gittinger <cg@exept.de>
parents: 2366
diff changeset
   521
    ^ '$Header: /cvs/stx/stx/libbasic/Autoload.st,v 1.66 1997-02-10 12:20:50 cg Exp $'
661
7e1c7358c980 version method at the end
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   522
! !
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   523
Autoload initialize!