Metaclass.st
author Claus Gittinger <cg@exept.de>
Tue, 09 Jul 2019 20:55:17 +0200
changeset 24417 03b083548da2
parent 24375 17f697620440
child 24833 94226f673308
permissions -rw-r--r--
#REFACTORING by exept class: Smalltalk class changed: #recursiveInstallAutoloadedClassesFrom:rememberIn:maxLevels:noAutoload:packageTop:showSplashInLevels: Transcript showCR:(... bindWith:...) -> Transcript showCR:... with:...
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24375
17f697620440 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24176
diff changeset
     1
"{ Encoding: utf8 }"
17f697620440 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24176
diff changeset
     2
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     3
"
5
67342904af11 *** empty log message ***
claus
parents: 3
diff changeset
     4
 COPYRIGHT (c) 1988 by Claus Gittinger
159
514c749165c3 *** empty log message ***
claus
parents: 93
diff changeset
     5
	      All Rights Reserved
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     6
a27a279701f8 Initial revision
claus
parents:
diff changeset
     7
 This software is furnished under a license and may be used
a27a279701f8 Initial revision
claus
parents:
diff changeset
     8
 only in accordance with the terms of that license and with the
a27a279701f8 Initial revision
claus
parents:
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
a27a279701f8 Initial revision
claus
parents:
diff changeset
    10
 be provided or otherwise made available to, or used by, any
a27a279701f8 Initial revision
claus
parents:
diff changeset
    11
 other person.  No title to or ownership of the software is
a27a279701f8 Initial revision
claus
parents:
diff changeset
    12
 hereby transferred.
a27a279701f8 Initial revision
claus
parents:
diff changeset
    13
"
5341
e7465ebd9126 change notification for new classes
Claus Gittinger <cg@exept.de>
parents: 5328
diff changeset
    14
"{ Package: 'stx:libbasic' }"
e7465ebd9126 change notification for new classes
Claus Gittinger <cg@exept.de>
parents: 5328
diff changeset
    15
17277
41175deb61ee class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 16769
diff changeset
    16
"{ NameSpace: Smalltalk }"
41175deb61ee class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 16769
diff changeset
    17
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
    18
ClassDescription subclass:#Metaclass
1047
5d4d1c7411ab dont clobber the binaryRevision from a nonBinary-one
ca
parents: 986
diff changeset
    19
	instanceVariableNames:'myClass'
2822
64829ed8f8c6 allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
    20
	classVariableNames:'ConfirmationQuerySignal'
1047
5d4d1c7411ab dont clobber the binaryRevision from a nonBinary-one
ca
parents: 986
diff changeset
    21
	poolDictionaries:''
5d4d1c7411ab dont clobber the binaryRevision from a nonBinary-one
ca
parents: 986
diff changeset
    22
	category:'Kernel-Classes'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    23
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    24
1742
e1ee359969f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1733
diff changeset
    25
!Metaclass class methodsFor:'documentation'!
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
    26
88
81dacba7a63a *** empty log message ***
claus
parents: 85
diff changeset
    27
copyright
81dacba7a63a *** empty log message ***
claus
parents: 85
diff changeset
    28
"
81dacba7a63a *** empty log message ***
claus
parents: 85
diff changeset
    29
 COPYRIGHT (c) 1988 by Claus Gittinger
159
514c749165c3 *** empty log message ***
claus
parents: 93
diff changeset
    30
	      All Rights Reserved
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    31
88
81dacba7a63a *** empty log message ***
claus
parents: 85
diff changeset
    32
 This software is furnished under a license and may be used
81dacba7a63a *** empty log message ***
claus
parents: 85
diff changeset
    33
 only in accordance with the terms of that license and with the
81dacba7a63a *** empty log message ***
claus
parents: 85
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
81dacba7a63a *** empty log message ***
claus
parents: 85
diff changeset
    35
 be provided or otherwise made available to, or used by, any
81dacba7a63a *** empty log message ***
claus
parents: 85
diff changeset
    36
 other person.  No title to or ownership of the software is
81dacba7a63a *** empty log message ***
claus
parents: 85
diff changeset
    37
 hereby transferred.
81dacba7a63a *** empty log message ***
claus
parents: 85
diff changeset
    38
"
621
87602c9d071c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 566
diff changeset
    39
!
87602c9d071c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 566
diff changeset
    40
87602c9d071c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 566
diff changeset
    41
documentation
87602c9d071c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 566
diff changeset
    42
"
87602c9d071c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 566
diff changeset
    43
    every classes class is a subclass of Metaclass.
87602c9d071c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 566
diff changeset
    44
    (i.e. every class is the sole instance of its Metaclass)
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
    45
    Metaclass provides support for creating new (sub)classes and/or
621
87602c9d071c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 566
diff changeset
    46
    changing the definition of an already existing class.
1292
89497fff7f87 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    47
89497fff7f87 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    48
    [author:]
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
    49
	Claus Gittinger
1669
4951596746f7 comments & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
    50
4951596746f7 comments & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
    51
    [see also:]
4951596746f7 comments & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1655
diff changeset
    52
	Behavior ClassDescription Class
621
87602c9d071c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 566
diff changeset
    53
"
88
81dacba7a63a *** empty log message ***
claus
parents: 85
diff changeset
    54
! !
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    55
2822
64829ed8f8c6 allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
    56
!Metaclass class methodsFor:'Signal constants'!
64829ed8f8c6 allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
    57
64829ed8f8c6 allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
    58
confirmationQuerySignal
64829ed8f8c6 allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
    59
    "return the query signal which is raised to ask if user
64829ed8f8c6 allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
    60
     confirmation dialogs should be opened.
64829ed8f8c6 allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
    61
     If unhandled, they are."
64829ed8f8c6 allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
    62
64829ed8f8c6 allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
    63
    ^ ConfirmationQuerySignal
64829ed8f8c6 allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
    64
64829ed8f8c6 allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
    65
    "Created: 31.7.1997 / 21:55:39 / cg"
64829ed8f8c6 allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
    66
! !
64829ed8f8c6 allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
    67
64829ed8f8c6 allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
    68
!Metaclass class methodsFor:'class initialization'!
64829ed8f8c6 allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
    69
64829ed8f8c6 allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
    70
initialize
12254
d42d245bc469 changed: #initialize
Stefan Vogel <sv@exept.de>
parents: 12217
diff changeset
    71
    ConfirmationQuerySignal isNil ifTrue:[
d42d245bc469 changed: #initialize
Stefan Vogel <sv@exept.de>
parents: 12217
diff changeset
    72
        ConfirmationQuerySignal := Query newSignal defaultAnswer:true.
d42d245bc469 changed: #initialize
Stefan Vogel <sv@exept.de>
parents: 12217
diff changeset
    73
    ].
2822
64829ed8f8c6 allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
    74
64829ed8f8c6 allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
    75
    "Modified: 31.7.1997 / 21:54:44 / cg"
64829ed8f8c6 allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
    76
! !
64829ed8f8c6 allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
    77
1742
e1ee359969f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1733
diff changeset
    78
!Metaclass class methodsFor:'creating metaclasses'!
356
claus
parents: 328
diff changeset
    79
claus
parents: 328
diff changeset
    80
new
claus
parents: 328
diff changeset
    81
    "creating a new metaclass - have to set the new classes
claus
parents: 328
diff changeset
    82
     flags correctly to have it behave like a metaclass ...
claus
parents: 328
diff changeset
    83
     Not for normal applications - creating new metaclasses is a very
claus
parents: 328
diff changeset
    84
     tricky thing; should be left to the gurus ;-)"
claus
parents: 328
diff changeset
    85
claus
parents: 328
diff changeset
    86
    |newMetaclass|
claus
parents: 328
diff changeset
    87
claus
parents: 328
diff changeset
    88
    newMetaclass := super new.
claus
parents: 328
diff changeset
    89
    newMetaclass instSize:(Class instSize).
claus
parents: 328
diff changeset
    90
    newMetaclass setSuperclass:Class.
claus
parents: 328
diff changeset
    91
claus
parents: 328
diff changeset
    92
    ^ newMetaclass
claus
parents: 328
diff changeset
    93
claus
parents: 328
diff changeset
    94
    "
claus
parents: 328
diff changeset
    95
     Metaclass new           <- new metaclass
claus
parents: 328
diff changeset
    96
     Metaclass new new       <- new class
claus
parents: 328
diff changeset
    97
     Metaclass new new new   <- new instance
claus
parents: 328
diff changeset
    98
    "
claus
parents: 328
diff changeset
    99
! !
claus
parents: 328
diff changeset
   100
24063
6193bcaef956 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23298
diff changeset
   101
!Metaclass class methodsFor:'method templates'!
6193bcaef956 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23298
diff changeset
   102
6193bcaef956 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23298
diff changeset
   103
classTemplateFor:aSuperClass in:categoryString asNamespace:asNameSpace private:isPrivate
6193bcaef956 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23298
diff changeset
   104
    "returning nil here, will let the browser generate a template.
6193bcaef956 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23298
diff changeset
   105
     However, special metaclasses (other languages)
6193bcaef956 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23298
diff changeset
   106
     may redefine this"
6193bcaef956 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23298
diff changeset
   107
     
6193bcaef956 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23298
diff changeset
   108
    ^ nil
6193bcaef956 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23298
diff changeset
   109
6193bcaef956 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23298
diff changeset
   110
    "Created: / 12-04-2019 / 05:18:51 / Claus Gittinger"
6193bcaef956 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23298
diff changeset
   111
! !
6193bcaef956 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23298
diff changeset
   112
1742
e1ee359969f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1733
diff changeset
   113
!Metaclass class methodsFor:'queries'!
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1087
diff changeset
   114
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   115
asPrivate
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   116
    ^ PrivateMetaclass
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   117
!
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   118
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1087
diff changeset
   119
isBuiltInClass
1266
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   120
    "return true if this class is known by the run-time-system.
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   121
     Here, true is returned for myself, false for subclasses."
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   122
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1087
diff changeset
   123
    ^ self == Metaclass class or:[self == Metaclass]
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1087
diff changeset
   124
1266
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   125
    "Modified: 23.4.1996 / 15:59:44 / cg"
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1087
diff changeset
   126
! !
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1087
diff changeset
   127
24375
17f697620440 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24176
diff changeset
   128
7261
f35fc9cee675 method category rename
Claus Gittinger <cg@exept.de>
parents: 6824
diff changeset
   129
!Metaclass methodsFor:'Compatibility-ST80'!
3012
25d64e4f2a4d added #comment:
Claus Gittinger <cg@exept.de>
parents: 2822
diff changeset
   130
25d64e4f2a4d added #comment:
Claus Gittinger <cg@exept.de>
parents: 2822
diff changeset
   131
comment:aString
25d64e4f2a4d added #comment:
Claus Gittinger <cg@exept.de>
parents: 2822
diff changeset
   132
    "ignored - sometimes found in ST-80 fileOut files.
25d64e4f2a4d added #comment:
Claus Gittinger <cg@exept.de>
parents: 2822
diff changeset
   133
     Comments are supposed to be defined via class messages."
25d64e4f2a4d added #comment:
Claus Gittinger <cg@exept.de>
parents: 2822
diff changeset
   134
25d64e4f2a4d added #comment:
Claus Gittinger <cg@exept.de>
parents: 2822
diff changeset
   135
    "Created: 9.10.1997 / 18:14:34 / cg"
3079
f177f98675c2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   136
!
f177f98675c2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   137
f177f98675c2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   138
sourceCodeTemplate
f177f98675c2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   139
    "ST80 compatibility - return a definition message for myself.
f177f98675c2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   140
     Same as #definition"
f177f98675c2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   141
f177f98675c2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   142
    ^ self soleInstance definition
f177f98675c2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   143
f177f98675c2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   144
    "Created: / 1.11.1997 / 13:16:45 / cg"
3012
25d64e4f2a4d added #comment:
Claus Gittinger <cg@exept.de>
parents: 2822
diff changeset
   145
! !
25d64e4f2a4d added #comment:
Claus Gittinger <cg@exept.de>
parents: 2822
diff changeset
   146
23298
b31d956df2bb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23297
diff changeset
   147
!Metaclass methodsFor:'Compatibility-Squeak'!
b31d956df2bb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23297
diff changeset
   148
b31d956df2bb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23297
diff changeset
   149
instanceVariableString:aString
b31d956df2bb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23297
diff changeset
   150
    "for compatibility"
b31d956df2bb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23297
diff changeset
   151
b31d956df2bb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23297
diff changeset
   152
    self instanceVariableNames:aString
b31d956df2bb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23297
diff changeset
   153
b31d956df2bb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23297
diff changeset
   154
    "Created: / 26-08-2018 / 16:29:13 / Claus Gittinger"
b31d956df2bb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23297
diff changeset
   155
! !
21407
6ce47a4b5aba #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 19115
diff changeset
   156
5578
16bfff464b2f added #isLoaded
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
   157
!Metaclass methodsFor:'autoload check'!
16bfff464b2f added #isLoaded
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
   158
16bfff464b2f added #isLoaded
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
   159
isLoaded
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   160
    "return true, if the class has been loaded;
5578
16bfff464b2f added #isLoaded
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
   161
     redefined in Autoload; see comment there"
16bfff464b2f added #isLoaded
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
   162
14647
55ae1eae669b sanity check
Claus Gittinger <cg@exept.de>
parents: 13475
diff changeset
   163
    ^ myClass isNil or:[ myClass isLoaded ]
5578
16bfff464b2f added #isLoaded
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
   164
16bfff464b2f added #isLoaded
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
   165
16bfff464b2f added #isLoaded
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
   166
! !
16bfff464b2f added #isLoaded
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
   167
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   168
!Metaclass methodsFor:'class instance variables'!
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   169
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   170
instanceVariableNames:aString
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   171
    "changing / adding class-inst vars -
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   172
     this actually creates a new metaclass and class, leaving the original
16769
3ef6b678e97d class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 16232
diff changeset
   173
     class hanging around as obsolete classes. 
3ef6b678e97d class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 16232
diff changeset
   174
     This may also be true for all subclasses, if class instance variables are added/removed in a superclass.
3ef6b678e97d class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 16232
diff changeset
   175
     Existing instances (i.e. insts of the class) are migrated to become instances of the new class(es).
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   176
16769
3ef6b678e97d class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 16232
diff changeset
   177
     However, if the old class is referenced somewhere (in a collection),
3ef6b678e97d class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 16232
diff changeset
   178
     that reference will still point to the old, now obsolete class.
3ef6b678e97d class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 16232
diff changeset
   179
     Time will show, if that is a problem and will be fixed."
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   180
6021
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   181
    |builder|
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   182
7518
298576c9de5a care for no real change in instanceVariableString.
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
   183
    self instanceVariableString asStringCollection = aString asStringCollection ifTrue:[^ self].
298576c9de5a care for no real change in instanceVariableString.
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
   184
6021
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   185
    builder := ClassBuilder new.
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   186
    builder oldMetaclass:self instanceVariableNames:aString.
16769
3ef6b678e97d class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 16232
diff changeset
   187
    builder rebuildForChangedClassInstanceVariables.
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   188
! !
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   189
5994
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   190
!Metaclass methodsFor:'compiler interface'!
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   191
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   192
browserClass
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   193
    "return the browser to use for this class -
5994
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   194
     this can be redefined in special classes, to get different browsers"
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   195
22244
1471c9a363dc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22138
diff changeset
   196
    ^ SystemBrowser default.
5994
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   197
22244
1471c9a363dc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22138
diff changeset
   198
    "Created: / 03-05-1996 / 12:36:40 / cg"
1471c9a363dc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22138
diff changeset
   199
    "Modified: / 01-09-2017 / 14:21:14 / cg"
5994
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   200
!
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   201
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   202
compilerClass
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   203
    "return the compiler to use for this class -
5994
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   204
     this can be redefined in special classes, to compile classes with
17678
ce74cee00020 class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 17592
diff changeset
   205
     JavaScript, Ruby, Lisp, Prolog, ASN1, Basic :-) or whatever syntax."
5994
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   206
12149
797e3911c35d added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   207
    ^ self programmingLanguage compilerClass.
12102
f00d93d94de7 changed:6 methods
Claus Gittinger <cg@exept.de>
parents: 12094
diff changeset
   208
f00d93d94de7 changed:6 methods
Claus Gittinger <cg@exept.de>
parents: 12094
diff changeset
   209
    "
f00d93d94de7 changed:6 methods
Claus Gittinger <cg@exept.de>
parents: 12094
diff changeset
   210
     Array compilerClass
f00d93d94de7 changed:6 methods
Claus Gittinger <cg@exept.de>
parents: 12094
diff changeset
   211
    "
5994
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   212
!
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   213
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   214
evaluatorClass
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   215
    "return the compiler to use for expression evaluation for this class -
5994
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   216
     this can be redefined in special classes, to evaluate expressions with
17678
ce74cee00020 class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 17592
diff changeset
   217
     JavaScript, Ruby, Lisp, Prolog, ASN1, Basic :-) or whatever syntax."
5994
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   218
12149
797e3911c35d added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   219
    ^ self programmingLanguage evaluatorClass.
12102
f00d93d94de7 changed:6 methods
Claus Gittinger <cg@exept.de>
parents: 12094
diff changeset
   220
f00d93d94de7 changed:6 methods
Claus Gittinger <cg@exept.de>
parents: 12094
diff changeset
   221
    "
f00d93d94de7 changed:6 methods
Claus Gittinger <cg@exept.de>
parents: 12094
diff changeset
   222
     Array evaluatorClass
f00d93d94de7 changed:6 methods
Claus Gittinger <cg@exept.de>
parents: 12094
diff changeset
   223
    "
5994
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   224
!
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   225
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   226
formatterClass
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   227
    "return the parser to use for formatting (prettyPrinting) this class -
5994
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   228
     this can be redefined in special classes, to format classes with
17678
ce74cee00020 class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 17592
diff changeset
   229
     JavaScript, Ruby, Lisp, Prolog, ASN1, Basic :-) or whatever syntax."
5994
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   230
12149
797e3911c35d added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   231
    ^ self programmingLanguage formatterClass.
5994
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   232
12102
f00d93d94de7 changed:6 methods
Claus Gittinger <cg@exept.de>
parents: 12094
diff changeset
   233
    "
f00d93d94de7 changed:6 methods
Claus Gittinger <cg@exept.de>
parents: 12094
diff changeset
   234
     Array formatterClass
f00d93d94de7 changed:6 methods
Claus Gittinger <cg@exept.de>
parents: 12094
diff changeset
   235
    "
5994
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   236
!
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   237
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   238
parserClass
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   239
    "return the parser to use for parsing this class -
5994
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   240
     this can be redefined in special classes, to parse classes with
17678
ce74cee00020 class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 17592
diff changeset
   241
     JavaScript, Ruby, Lisp, Prolog, ASN1, Basic :-) or whatever syntax."
5994
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   242
12149
797e3911c35d added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   243
    ^ self programmingLanguage parserClass.
5994
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   244
12102
f00d93d94de7 changed:6 methods
Claus Gittinger <cg@exept.de>
parents: 12094
diff changeset
   245
    "
f00d93d94de7 changed:6 methods
Claus Gittinger <cg@exept.de>
parents: 12094
diff changeset
   246
     Array parserClass
f00d93d94de7 changed:6 methods
Claus Gittinger <cg@exept.de>
parents: 12094
diff changeset
   247
    "
5994
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   248
!
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   249
12149
797e3911c35d added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   250
programmingLanguage
797e3911c35d added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   251
    "return the programming language in which this class is written"
797e3911c35d added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   252
797e3911c35d added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   253
    ^ SmalltalkLanguage instance
797e3911c35d added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   254
797e3911c35d added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   255
    "Created: / 15-08-2009 / 09:06:25 / Jan Vrany <vranyj1@fel.cvut.cz>"
797e3911c35d added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   256
    "Modified: / 16-08-2009 / 10:37:08 / Jan Vrany <vranyj1@fel.cvut.cz>"
797e3911c35d added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   257
!
797e3911c35d added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   258
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   259
realSubclassDefinerClass
17678
ce74cee00020 class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 17592
diff changeset
   260
    "Answer an evaluator class appropriate for evaluating definitions of new
ce74cee00020 class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 17592
diff changeset
   261
     subclasses of this class."
ce74cee00020 class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 17592
diff changeset
   262
ce74cee00020 class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 17592
diff changeset
   263
    "cg: @jan - what is the difference to the subclassDefinerClass?"
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   264
    ^ self evaluatorClass
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   265
!
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   266
5994
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   267
subclassDefinerClass
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   268
    "Answer an evaluator class appropriate for evaluating definitions of new
5994
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   269
     subclasses of this class."
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   270
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   271
    ^ self evaluatorClass
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   272
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   273
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   274
!
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   275
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   276
syntaxHighlighterClass
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   277
    "return the class to use for syntaxHighlighting (prettyPrinting) this class -
5994
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   278
     this can be redefined in special classes, to highlight classes with
17678
ce74cee00020 class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 17592
diff changeset
   279
     JavaScript, Ruby, Lisp, Prolog, ASN1, Basic :-) or whatever syntax."
5994
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   280
12149
797e3911c35d added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   281
    ^ self programmingLanguage syntaxHighlighterClass.
5994
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   282
12102
f00d93d94de7 changed:6 methods
Claus Gittinger <cg@exept.de>
parents: 12094
diff changeset
   283
    "
f00d93d94de7 changed:6 methods
Claus Gittinger <cg@exept.de>
parents: 12094
diff changeset
   284
     Array syntaxHighlighterClass
f00d93d94de7 changed:6 methods
Claus Gittinger <cg@exept.de>
parents: 12094
diff changeset
   285
    "
5994
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   286
! !
554530710162 allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents: 5891
diff changeset
   287
24176
d261694dd722 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24063
diff changeset
   288
!Metaclass methodsFor:'copying-private'!
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   289
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   290
postCopy
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   291
    "redefined - a copy may have a new instance"
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   292
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   293
    myClass := nil
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   294
! !
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   295
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   296
!Metaclass methodsFor:'creating classes'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   297
10475
acc087c36c83 documentation only
Claus Gittinger <cg@exept.de>
parents: 9712
diff changeset
   298
name:newName inEnvironment:aNameSpaceOrOwningClass
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   299
	     subclassOf:aClass
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   300
	     instanceVariableNames:stringOfInstVarNames
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   301
	     variable:variableBoolean
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   302
	     words:wordsBoolean
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   303
	     pointers:pointersBoolean
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   304
	     classVariableNames:stringOfClassVarNames
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   305
	     poolDictionaries:stringOfPoolNames
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   306
	     category:categoryString
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   307
	     comment:commentString
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   308
	     changed:changed
6824
6fbe85d05646 ...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents: 6516
diff changeset
   309
6fbe85d05646 ...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents: 6516
diff changeset
   310
    ^ self
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   311
	name:newName
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   312
	inEnvironment:aNameSpaceOrOwningClass
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   313
	subclassOf:aClass
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   314
	instanceVariableNames:stringOfInstVarNames
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   315
	variable:variableBoolean
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   316
	words:wordsBoolean
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   317
	pointers:pointersBoolean
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   318
	classVariableNames:stringOfClassVarNames
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   319
	poolDictionaries:stringOfPoolNames
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   320
	category:categoryString
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   321
	comment:commentString
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   322
	changed:changed
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   323
	classInstanceVariableNames:nil
6824
6fbe85d05646 ...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents: 6516
diff changeset
   324
6fbe85d05646 ...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents: 6516
diff changeset
   325
    "Modified: 16.6.1997 / 11:53:58 / cg"
6fbe85d05646 ...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents: 6516
diff changeset
   326
!
6fbe85d05646 ...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents: 6516
diff changeset
   327
10475
acc087c36c83 documentation only
Claus Gittinger <cg@exept.de>
parents: 9712
diff changeset
   328
name:newName inEnvironment:aNameSpaceOrOwningClass
19115
mawalch
parents: 18890
diff changeset
   329
             subclassOf:aClass
mawalch
parents: 18890
diff changeset
   330
             instanceVariableNames:stringOfInstVarNames
mawalch
parents: 18890
diff changeset
   331
             variable:variableBoolean
mawalch
parents: 18890
diff changeset
   332
             words:wordsBoolean
mawalch
parents: 18890
diff changeset
   333
             pointers:pointersBoolean
mawalch
parents: 18890
diff changeset
   334
             classVariableNames:stringOfClassVarNames
mawalch
parents: 18890
diff changeset
   335
             poolDictionaries:stringOfPoolNames
mawalch
parents: 18890
diff changeset
   336
             category:categoryString
mawalch
parents: 18890
diff changeset
   337
             comment:commentString
mawalch
parents: 18890
diff changeset
   338
             changed:changed
mawalch
parents: 18890
diff changeset
   339
             classInstanceVariableNames:stringOfClassInstVarNamesOrNil
1439
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   340
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   341
    "this is the main workhorse for installing new classes - special care
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   342
     has to be taken, when changing an existing classes definition. In this
22371
1af34d1ea5a5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22244
diff changeset
   343
     case, some or all of the methods and subclass-methods have to be
1439
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   344
     recompiled.
19115
mawalch
parents: 18890
diff changeset
   345
     Also, the old class(es) are still kept (but not accessible as a global),
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   346
     to allow existing instances some life.
1439
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   347
     This might change in the future.
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   348
    "
21407
6ce47a4b5aba #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 19115
diff changeset
   349
    |builder newClass|
6021
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   350
6516
68fdff63c92b allow for classBuilder to be provided by subclasses
Claus Gittinger <cg@exept.de>
parents: 6082
diff changeset
   351
    builder := self newClassBuilder.
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   352
    builder name:newName
19115
mawalch
parents: 18890
diff changeset
   353
        inEnvironment:aNameSpaceOrOwningClass
mawalch
parents: 18890
diff changeset
   354
        subclassOf:aClass
mawalch
parents: 18890
diff changeset
   355
        instanceVariableNames:stringOfInstVarNames
mawalch
parents: 18890
diff changeset
   356
        variable:variableBoolean
mawalch
parents: 18890
diff changeset
   357
        words:wordsBoolean
mawalch
parents: 18890
diff changeset
   358
        pointers:pointersBoolean
mawalch
parents: 18890
diff changeset
   359
        classVariableNames:stringOfClassVarNames
mawalch
parents: 18890
diff changeset
   360
        poolDictionaries:stringOfPoolNames
mawalch
parents: 18890
diff changeset
   361
        category:categoryString
mawalch
parents: 18890
diff changeset
   362
        comment:commentString
mawalch
parents: 18890
diff changeset
   363
        changed:changed
mawalch
parents: 18890
diff changeset
   364
        classInstanceVariableNames:stringOfClassInstVarNamesOrNil.
21407
6ce47a4b5aba #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 19115
diff changeset
   365
    newClass := builder buildClass.
6ce47a4b5aba #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 19115
diff changeset
   366
22138
45645f969d48 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 21607
diff changeset
   367
    newClass notNil ifTrue:[
45645f969d48 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 21607
diff changeset
   368
        "/ if the class was autoloaded, and it refers to any autoloaded shared pool,
45645f969d48 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 21607
diff changeset
   369
        "/ reference the pool now. So it will be present, when methods are compiled
45645f969d48 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 21607
diff changeset
   370
        "/ (avoids costy recompiles which may happen, if the sharedPool is loaded 
45645f969d48 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 21607
diff changeset
   371
        "/  after the methods have been compiled assuming that those names are globals)
45645f969d48 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 21607
diff changeset
   372
        (newClass sharedPools ? #()) do:[:each | each autoload].
45645f969d48 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 21607
diff changeset
   373
    ].
21407
6ce47a4b5aba #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 19115
diff changeset
   374
    ^ newClass
6ce47a4b5aba #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 19115
diff changeset
   375
22138
45645f969d48 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 21607
diff changeset
   376
    "Modified: / 28-07-2017 / 13:40:22 / cg"
22371
1af34d1ea5a5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22244
diff changeset
   377
    "Modified (comment): / 21-11-2017 / 13:03:39 / cg"
6021
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   378
!
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   379
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   380
new
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   381
    "create & return a new metaclass (a classes class).
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   382
     Since metaclasses only have one instance (the class),
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   383
     complain if there is already one.
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   384
     You get a new class by sending #new to the returned metaclass
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   385
     (confusing - isn't it ?)"
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   386
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   387
    |newClass|
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   388
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   389
    myClass notNil ifTrue:[
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   390
	self error:'Each metaclass may only have one instance'.
6021
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   391
    ].
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   392
    newClass := self basicNew.
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   393
    newClass
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   394
	setSuperclass:Object
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   395
	methodDictionary:(MethodDictionary new)
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   396
	instSize:0
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   397
	flags:(Behavior flagBehavior).
6021
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   398
    myClass := newClass.
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   399
    ^ newClass
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   400
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   401
    "Modified: 1.4.1997 / 15:44:50 / stefan"
6516
68fdff63c92b allow for classBuilder to be provided by subclasses
Claus Gittinger <cg@exept.de>
parents: 6082
diff changeset
   402
!
68fdff63c92b allow for classBuilder to be provided by subclasses
Claus Gittinger <cg@exept.de>
parents: 6082
diff changeset
   403
68fdff63c92b allow for classBuilder to be provided by subclasses
Claus Gittinger <cg@exept.de>
parents: 6082
diff changeset
   404
newClassBuilder
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   405
    ^ ClassBuilder new metaclass:self class.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   406
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   407
5562
76675d5a0da9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5515
diff changeset
   408
!Metaclass methodsFor:'enumerating'!
76675d5a0da9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5515
diff changeset
   409
6078
13d651d69246 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 6021
diff changeset
   410
instAndClassSelectorsAndMethodsDo:aTwoArgBlock
13d651d69246 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 6021
diff changeset
   411
    myClass instAndClassSelectorsAndMethodsDo:aTwoArgBlock
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
   412
!
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
   413
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
   414
subclassesDo:aBlock
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
   415
    "evaluate the argument, aBlock for all immediate subclasses.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
   416
     This will only enumerate globally known classes - for anonymous
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
   417
     behaviors, you have to walk over all instances of Behavior."
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
   418
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
   419
    "metaclasses are not found via Smalltalk allClassesDo:
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
   420
     here, walk over classes and enumerate corresponding metas"
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
   421
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
   422
    self soleInstance subclassesDo:[:aSubClass |
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   423
	aBlock value:aSubClass class
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
   424
    ].
5562
76675d5a0da9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5515
diff changeset
   425
! !
76675d5a0da9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5515
diff changeset
   426
3640
523d80dfc3ac added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3629
diff changeset
   427
!Metaclass methodsFor:'fileOut'!
523d80dfc3ac added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3629
diff changeset
   428
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   429
basicFileOutDefinitionOf:aClass on:aStream withNameSpace:forceNameSpace withPackage:showPackage
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   430
    "append an expression on aStream, which defines myself."
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   431
8716
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8551
diff changeset
   432
    |syntaxHilighting|
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   433
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   434
    UserPreferences isNil ifTrue:[
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   435
	syntaxHilighting := false
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   436
    ] ifFalse:[
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   437
	syntaxHilighting := UserPreferences current syntaxColoring.
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   438
    ].
8716
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8551
diff changeset
   439
    self
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   440
	basicFileOutDefinitionOf:aClass
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   441
	on:aStream
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   442
	withNameSpace:forceNameSpace
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   443
	withPackage:showPackage
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   444
	syntaxHilighting:syntaxHilighting
8716
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8551
diff changeset
   445
!
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8551
diff changeset
   446
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8551
diff changeset
   447
basicFileOutDefinitionOf:aClass on:aStream withNameSpace:forceNameSpace withPackage:showPackage syntaxHilighting:syntaxHilighting
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8551
diff changeset
   448
    "append an expression on aStream, which defines myself."
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8551
diff changeset
   449
17277
41175deb61ee class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 16769
diff changeset
   450
    |s owner namespace nsName fullName forceNoNameSpace superNameWithoutNameSpacePrefix cls topOwner
9689
6213791d1760 do not store NoProject-classes (leave them unspecified in the source)
Claus Gittinger <cg@exept.de>
parents: 9197
diff changeset
   451
     superclass superclassNamespace nm useStoreString boldOn boldOff pkg|
8765
97227ad9480c care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents: 8716
diff changeset
   452
97227ad9480c care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents: 8716
diff changeset
   453
    syntaxHilighting ifTrue:[
12217
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   454
        boldOn := [aStream bold].
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   455
        boldOff := [aStream normal].
8765
97227ad9480c care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents: 8716
diff changeset
   456
    ].
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   457
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   458
    fullName := FileOutNameSpaceQuerySignal query == true.
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   459
    owner := aClass owningClass.
17277
41175deb61ee class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 16769
diff changeset
   460
    namespace := aClass topNameSpace.
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   461
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   462
    (showPackage and:[owner isNil]) ifTrue:[
12217
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   463
        pkg := aClass getPackage.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   464
        (pkg notNil and:[pkg ~= PackageId noProjectID]) ifTrue:[
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   465
            aStream nextPutAll:'"{ Package: '''.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   466
            aStream nextPutAll:aClass package asString.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   467
            aStream nextPutAll:''' }"'; cr; cr.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   468
        ]
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   469
    ].
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   470
16232
c561a9ff8d9f Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 15956
diff changeset
   471
c561a9ff8d9f Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 15956
diff changeset
   472
"/  No, always use namespace pragma, otherwise when reading back
c561a9ff8d9f Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 15956
diff changeset
   473
"/  from stream, we need somehow to tell what's namespace and what's
23266
4c05e7e863de #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22418
diff changeset
   474
"/  a private class in another class. So namespaces are **always** denoted by
16232
c561a9ff8d9f Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 15956
diff changeset
   475
"/  namespace pragma.
c561a9ff8d9f Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 15956
diff changeset
   476
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   477
    "/ the backward compatible namespace directive is only used
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   478
    "/ for non-private classes.
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   479
    "/ Private classes cannot be filed into another smalltalk anyway,
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   480
    "/ and there is no need to complicate global lookup in stc...
16232
c561a9ff8d9f Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 15956
diff changeset
   481
"/ 
c561a9ff8d9f Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 15956
diff changeset
   482
"/    owner notNil ifTrue:[
c561a9ff8d9f Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 15956
diff changeset
   483
"/        forceNoNameSpace := ForceNoNameSpaceQuerySignal query == true.
c561a9ff8d9f Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 15956
diff changeset
   484
"/        forceNoNameSpace ifFalse:[
c561a9ff8d9f Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 15956
diff changeset
   485
"/            fullName := true.
c561a9ff8d9f Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 15956
diff changeset
   486
"/        ]
c561a9ff8d9f Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 15956
diff changeset
   487
"/    ].
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   488
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   489
    fullName ifFalse:[
12217
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   490
        (owner isNil or:[forceNameSpace]) ifTrue:[
17277
41175deb61ee class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 16769
diff changeset
   491
            (namespace notNil and:[namespace ~~ Smalltalk]) ifTrue:[
41175deb61ee class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 16769
diff changeset
   492
                nsName := namespace name.
12217
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   493
                (nsName includes:$:) ifTrue:[
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   494
                    nsName := '''' , nsName , ''''
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   495
                ].
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   496
                aStream nextPutAll:'"{ NameSpace: '.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   497
                boldOn value.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   498
                aStream nextPutAll:nsName.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   499
                boldOff value.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   500
                aStream nextPutAll:' }"'; cr; cr.
17277
41175deb61ee class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 16769
diff changeset
   501
            ] ifFalse:[
41175deb61ee class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 16769
diff changeset
   502
                "/ always write a namespace directive - even for smalltalk classes.
41175deb61ee class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 16769
diff changeset
   503
                "/ reason: the fileout might go into a big file containing multiple classes
41175deb61ee class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 16769
diff changeset
   504
                "/ in different namespaces (otherwise, the smalltalk class would later be filed into
41175deb61ee class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 16769
diff changeset
   505
                "/ the previous class's namespace)
23266
4c05e7e863de #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22418
diff changeset
   506
                (Smalltalk at:aClass name) == aClass ifTrue:[
4c05e7e863de #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22418
diff changeset
   507
                    aStream nextPutAll:'"{ NameSpace: Smalltalk }"'; cr; cr.
4c05e7e863de #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22418
diff changeset
   508
                ] ifFalse:[
4c05e7e863de #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22418
diff changeset
   509
                    aStream nextPutAll:'"{ NameSpace: nil }"'; cr; cr.
4c05e7e863de #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22418
diff changeset
   510
                ].    
17277
41175deb61ee class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 16769
diff changeset
   511
            ].
12217
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   512
        ].
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   513
    ].
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   514
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   515
    "take care of nil-superclass"
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   516
    superclass := aClass superclass.
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   517
    superclass isNil ifTrue:[
12217
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   518
        s := 'nil'
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   519
    ] ifFalse:[
12217
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   520
        superclassNamespace := superclass nameSpace.
9197
e900514c8065 superclass name again
Claus Gittinger <cg@exept.de>
parents: 9175
diff changeset
   521
12217
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   522
        "/ be careful: if the superclasses ns is Smalltalk,
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   523
        "/ AND this is the definition of a private class,
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   524
        "/ AND a private class with the same name as my superclas
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   525
        "/ exists in my owning class,
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   526
        "/ THEN we MUST add the smalltalk-prefix.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   527
        "/ (otherwise, we get the private class as superclass when accepting the
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   528
        "/  next time)
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   529
        (owner notNil
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   530
        and:[ superclassNamespace == Smalltalk
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   531
        and:[ (owner privateClassesAt:superclass name) notNil ]]) ifTrue:[
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   532
            s := superclass nameWithNameSpacePrefix.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   533
        ] ifFalse:[
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   534
            fullName ifTrue:[
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   535
                s := superclass name.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   536
            ] ifFalse:[
17277
41175deb61ee class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 16769
diff changeset
   537
                (namespace == superclassNamespace
12217
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   538
                and:[superclass owningClass isNil]) ifTrue:[
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   539
                    "/ superclass is in the same namespace and not private;
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   540
                    "/ still prepend namespace prefix for private classes,
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   541
                    "/  to avoid confusing stc, which needs that information.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   542
                    "/ LATE note (AUG2002) - no longer; stc was fixed.
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   543
"/                owner notNil ifTrue:[
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   544
"/                    s := superclass name
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   545
"/                ] ifFalse:[
12217
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   546
                        s := superclass nameWithoutPrefix
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   547
"/                ]
12217
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   548
                ] ifFalse:[
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   549
                    "/ a very special (rare) situation:
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   550
                    "/ my superclass resides in another nameSpace,
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   551
                    "/ but there is something else named like this
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   552
                    "/ to be found in my nameSpace (or a private class)
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   553
12217
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   554
                    superNameWithoutNameSpacePrefix := superclass nameWithoutNameSpacePrefix asSymbol.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   555
                    cls := aClass privateClassesAt:superNameWithoutNameSpacePrefix.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   556
                    cls isNil ifTrue:[
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   557
                        (topOwner := aClass topOwningClass) isNil ifTrue:[
17277
41175deb61ee class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 16769
diff changeset
   558
                            namespace := aClass nameSpace.
41175deb61ee class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 16769
diff changeset
   559
                            namespace notNil ifTrue:[
41175deb61ee class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 16769
diff changeset
   560
                                cls := namespace privateClassesAt:superNameWithoutNameSpacePrefix
12217
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   561
                            ] ifFalse:[
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   562
                                "/ aClass error:'unexpected nil namespace'
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   563
                            ]
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   564
                        ] ifFalse:[
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   565
                            cls := topOwner nameSpace at:superNameWithoutNameSpacePrefix.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   566
                        ]
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   567
                    ].
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   568
                    (cls notNil and:[cls ~~ superclass]) ifTrue:[
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   569
                        s := superclassNamespace name , '::' , superNameWithoutNameSpacePrefix
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   570
                    ] ifFalse:[
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   571
                        "/ no class with that name found in my namespace ...
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   572
                        "/ if the superclass resides in Smalltalk,
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   573
                        "/ suppress prefix; otherwise, use full prefix.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   574
                        (superclassNamespace notNil
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   575
                         and:[superclassNamespace ~~ Smalltalk]) ifTrue:[
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   576
                            (owner notNil
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   577
                             and:[(topOwner := owner topOwningClass) notNil
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   578
                             and:[superclass topOwningClass notNil
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   579
                             and:[topOwner nameSpace == superclass topOwningClass "owningClass" nameSpace]
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   580
                            ]]) ifTrue:[
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   581
                                s := superNameWithoutNameSpacePrefix
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   582
                            ] ifFalse:[
17277
41175deb61ee class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 16769
diff changeset
   583
                                namespace == superclass topNameSpace ifTrue:[
12217
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   584
                                    s := superNameWithoutNameSpacePrefix
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   585
                                ] ifFalse:[
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   586
                                    s := superclass name
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   587
                                ]
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   588
                            ]
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   589
                        ] ifFalse:[
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   590
                            s := superNameWithoutNameSpacePrefix
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   591
                        ]
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   592
                    ]
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   593
                ]
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   594
            ]
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   595
        ]
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   596
    ].
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   597
9175
2d009bbc418b care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents: 8765
diff changeset
   598
    boldOn value.
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   599
    aStream nextPutAll:s.   "/ superclass
9175
2d009bbc418b care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents: 8765
diff changeset
   600
    boldOff value.
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   601
    aStream space.
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   602
    aClass basicFileOutInstvarTypeKeywordOn:aStream.
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   603
8765
97227ad9480c care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents: 8716
diff changeset
   604
    useStoreString := false.
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   605
    (fullName and:[owner isNil]) ifTrue:[
12217
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   606
        nm := aClass name.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   607
        useStoreString := true.
8765
97227ad9480c care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents: 8716
diff changeset
   608
    ] ifFalse:[
12217
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   609
        nm := aClass nameWithoutPrefix.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   610
        nm isValidSmalltalkIdentifier ifFalse:[
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   611
            useStoreString := true.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   612
        ].
8765
97227ad9480c care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents: 8716
diff changeset
   613
    ].
97227ad9480c care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents: 8716
diff changeset
   614
    aStream nextPut:$#.
97227ad9480c care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents: 8716
diff changeset
   615
    useStoreString ifTrue:[
12217
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   616
        aStream nextPutAll:''''.
8765
97227ad9480c care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents: 8716
diff changeset
   617
    ].
9175
2d009bbc418b care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents: 8765
diff changeset
   618
    boldOn value.
8765
97227ad9480c care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents: 8716
diff changeset
   619
    aStream nextPutAll:nm.
9175
2d009bbc418b care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents: 8765
diff changeset
   620
    boldOff value.
8765
97227ad9480c care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents: 8716
diff changeset
   621
    useStoreString ifTrue:[
12217
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   622
        aStream nextPutAll:''''.
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   623
    ].
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   624
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   625
    aStream crtab.
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   626
    aStream nextPutAll:'instanceVariableNames:'''.
9175
2d009bbc418b care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents: 8765
diff changeset
   627
    boldOn value.
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   628
    aClass printInstVarNamesOn:aStream indent:16.
9175
2d009bbc418b care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents: 8765
diff changeset
   629
    boldOff value.
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   630
    aStream nextPutAll:''''.
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   631
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   632
    aStream crtab.
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   633
    aStream nextPutAll:'classVariableNames:'''.
9175
2d009bbc418b care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents: 8765
diff changeset
   634
    boldOn value.
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   635
    aClass printClassVarNamesOn:aStream indent:16.
9175
2d009bbc418b care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents: 8765
diff changeset
   636
    boldOff value.
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   637
    aStream nextPutAll:''''.
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   638
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   639
    aStream crtab.
8551
de314b9f8fa3 sharedPools
ca
parents: 8277
diff changeset
   640
    aStream nextPutAll:'poolDictionaries:'''.
9175
2d009bbc418b care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents: 8765
diff changeset
   641
    boldOn value.
8551
de314b9f8fa3 sharedPools
ca
parents: 8277
diff changeset
   642
    aClass printSharedPoolNamesOn:aStream indent:16.
9175
2d009bbc418b care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents: 8765
diff changeset
   643
    boldOff value.
8551
de314b9f8fa3 sharedPools
ca
parents: 8277
diff changeset
   644
    aStream nextPutAll:''''.
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   645
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   646
    aStream crtab.
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   647
    owner isNil ifTrue:[
12217
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   648
        "/ a public class
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   649
        aStream nextPutAll:'category:'.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   650
        aClass category isNil ifTrue:[
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   651
            s := ''''''
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   652
        ] ifFalse:[
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   653
            s := aClass category asString storeString
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   654
        ].
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   655
        aStream nextPutAll:s.
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   656
    ] ifFalse:[
12217
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   657
        "/ a private class
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   658
        aStream nextPutAll:'privateIn:'.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   659
        boldOn value.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   660
        fullName ifTrue:[
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   661
            s := owner name.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   662
        ] ifFalse:[
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   663
            s := owner nameWithoutNameSpacePrefix.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   664
        ].
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   665
        aStream nextPutAll:s.
379dcf29b04a Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents: 12149
diff changeset
   666
        boldOff value.
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   667
    ].
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   668
    aStream cr
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   669
10739
9602cd5ad8a0 changed #basicFileOutDefinitionOf:on:withNameSpace:withPackage:syntaxHilighting:
Claus Gittinger <cg@exept.de>
parents: 10475
diff changeset
   670
    "Created: / 04-01-1997 / 20:38:16 / cg"
9602cd5ad8a0 changed #basicFileOutDefinitionOf:on:withNameSpace:withPackage:syntaxHilighting:
Claus Gittinger <cg@exept.de>
parents: 10475
diff changeset
   671
    "Modified: / 18-03-1999 / 18:15:46 / stefan"
10740
Claus Gittinger <cg@exept.de>
parents: 10739
diff changeset
   672
    "Modified: / 08-10-2007 / 13:28:59 / cg"
16232
c561a9ff8d9f Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 15956
diff changeset
   673
    "Modified: / 06-03-2014 / 10:32:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
23266
4c05e7e863de #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22418
diff changeset
   674
    "Modified: / 08-08-2018 / 09:06:17 / Claus Gittinger"
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   675
!
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7518
diff changeset
   676
8277
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   677
fileOutClassInstVarDefinitionOn:aStream withNameSpace:withNameSpace
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   678
    "append an expression to define my classInstanceVariables on aStream"
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   679
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   680
    |anySuperClassInstVar|
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   681
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   682
    myClass isLoaded ifFalse:[
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   683
	^ myClass basicFileOutDefinitionOn:aStream withNameSpace:withNameSpace
8277
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   684
    ].
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   685
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   686
    withNameSpace ifTrue:[
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   687
	myClass name printOn:aStream.
8277
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   688
    ] ifFalse:[
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   689
	myClass printClassNameOn:aStream.
8277
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   690
    ].
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   691
    aStream nextPutAll:' class instanceVariableNames:'''.
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   692
    self printInstVarNamesOn:aStream indent:8.
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   693
    aStream nextPutAll:''''.
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   694
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   695
    "mhmh - good idea; saw this in SmallDraw sourcecode ..."
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   696
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   697
    anySuperClassInstVar := false.
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   698
    myClass allSuperclassesDo:[:aSuperClass |
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   699
	aSuperClass class instVarNames do:[:ignored | anySuperClassInstVar := true].
8277
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   700
    ].
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   701
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   702
    aStream cr; cr; nextPut:(Character doubleQuote); cr; space.
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   703
    anySuperClassInstVar ifFalse:[
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   704
	aStream
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   705
	    nextPutLine:'No other class instance variables are inherited by this class.'.
8277
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   706
    ] ifTrue:[
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   707
	aStream
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   708
	    nextPutLine:'The following class instance variables are inherited by this class:'.
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   709
	aStream cr.
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   710
	myClass allSuperclassesDo:[:aSuperClass |
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   711
	    aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '.
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   712
	    aStream nextPutLine:(aSuperClass class instanceVariableString).
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   713
	].
8277
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   714
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   715
    ].
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   716
    aStream nextPut:(Character doubleQuote); cr.
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   717
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   718
    "Created: / 10.12.1995 / 16:31:25 / cg"
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   719
    "Modified: / 1.4.1997 / 16:00:33 / stefan"
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   720
    "Modified: / 3.2.2000 / 23:05:28 / cg"
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   721
!
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
   722
3640
523d80dfc3ac added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3629
diff changeset
   723
fileOutDefinitionOn:aStream
523d80dfc3ac added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3629
diff changeset
   724
    myClass fileOutClassInstVarDefinitionOn:aStream
523d80dfc3ac added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3629
diff changeset
   725
523d80dfc3ac added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3629
diff changeset
   726
    "Modified: / 21.6.1998 / 04:10:02 / cg"
8228
cd5c696619a3 use chunkfilewriter for fileOut
ca
parents: 7617
diff changeset
   727
!
cd5c696619a3 use chunkfilewriter for fileOut
ca
parents: 7617
diff changeset
   728
cd5c696619a3 use chunkfilewriter for fileOut
ca
parents: 7617
diff changeset
   729
fileOutOn:outStreamArg withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition methodFilter:methodFilter encoder:encoderOrNil
cd5c696619a3 use chunkfilewriter for fileOut
ca
parents: 7617
diff changeset
   730
    "file out my definition and all methods onto aStream.
cd5c696619a3 use chunkfilewriter for fileOut
ca
parents: 7617
diff changeset
   731
     If stampIt is true, a timeStamp comment is prepended.
cd5c696619a3 use chunkfilewriter for fileOut
ca
parents: 7617
diff changeset
   732
     If initIt is true, and the class implements a class-initialize method,
cd5c696619a3 use chunkfilewriter for fileOut
ca
parents: 7617
diff changeset
   733
     append a corresponding doIt expression for initialization.
cd5c696619a3 use chunkfilewriter for fileOut
ca
parents: 7617
diff changeset
   734
     The order by which the fileOut is done is used to put the version string at the end.
cd5c696619a3 use chunkfilewriter for fileOut
ca
parents: 7617
diff changeset
   735
     Thus, if the version string is expanded (by CVS), the characterPositions of methods should not move"
cd5c696619a3 use chunkfilewriter for fileOut
ca
parents: 7617
diff changeset
   736
12149
797e3911c35d added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   737
    self programmingLanguage sourceFileWriterClass new
797e3911c35d added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   738
        fileOut:myClass on:outStreamArg withTimeStamp:stampIt
797e3911c35d added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   739
        withInitialize:initIt withDefinition:withDefinition
797e3911c35d added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   740
        methodFilter:methodFilter encoder:encoderOrNil
3640
523d80dfc3ac added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3629
diff changeset
   741
! !
523d80dfc3ac added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3629
diff changeset
   742
12029
e342ae59d264 added: #versionMethodTemplateForSourceCodeManager:
fm
parents: 11989
diff changeset
   743
!Metaclass methodsFor:'method templates'!
e342ae59d264 added: #versionMethodTemplateForSourceCodeManager:
fm
parents: 11989
diff changeset
   744
e342ae59d264 added: #versionMethodTemplateForSourceCodeManager:
fm
parents: 11989
diff changeset
   745
versionMethodTemplateForSourceCodeManager:aSourceCodeManager
e342ae59d264 added: #versionMethodTemplateForSourceCodeManager:
fm
parents: 11989
diff changeset
   746
    ^ aSourceCodeManager versionMethodTemplateForSmalltalk
e342ae59d264 added: #versionMethodTemplateForSourceCodeManager:
fm
parents: 11989
diff changeset
   747
! !
e342ae59d264 added: #versionMethodTemplateForSourceCodeManager:
fm
parents: 11989
diff changeset
   748
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   749
!Metaclass methodsFor:'misc ui support'!
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   750
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   751
iconInBrowserSymbol
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   752
    "can be redefined for a private icon in the browser.
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   753
     The returned symbol must be a selector of the ToolbarIconLibrary."
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   754
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   755
    ^ nil
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   756
! !
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   757
1875
215b61efaae9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
   758
!Metaclass methodsFor:'private'!
68
59faa75185ba *** empty log message ***
claus
parents: 49
diff changeset
   759
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   760
setSoleInstance:aClass
6021
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   761
    myClass := aClass
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   762
3fe69dd0d081 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5994
diff changeset
   763
    "Created: 12.12.1995 / 13:46:22 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   764
! !
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   765
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   766
!Metaclass methodsFor:'queries'!
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   767
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   768
category
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   769
    "return my category"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   770
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   771
    myClass isNil ifTrue:[^ nil].
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   772
    ^ myClass category
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   773
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   774
    "Created: 2.4.1997 / 00:46:11 / stefan"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   775
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   776
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   777
comment
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   778
    "return my comment"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   779
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   780
    ^ myClass comment
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   781
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   782
    "Created: 2.4.1997 / 00:51:35 / stefan"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   783
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   784
22418
b185e9c1f394 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 22371
diff changeset
   785
environment
b185e9c1f394 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 22371
diff changeset
   786
    "return the namespace I am contained in; ST-80 compatible name"
b185e9c1f394 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 22371
diff changeset
   787
b185e9c1f394 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 22371
diff changeset
   788
    myClass isNil ifTrue:[^ nil].
b185e9c1f394 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 22371
diff changeset
   789
    ^ myClass environment
b185e9c1f394 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 22371
diff changeset
   790
b185e9c1f394 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 22371
diff changeset
   791
    "Created: / 12-01-2018 / 14:04:01 / stefan"
b185e9c1f394 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 22371
diff changeset
   792
!
b185e9c1f394 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 22371
diff changeset
   793
9712
02d0e21d6c67 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9695
diff changeset
   794
getPackage
02d0e21d6c67 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9695
diff changeset
   795
    "return my package-id"
02d0e21d6c67 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9695
diff changeset
   796
02d0e21d6c67 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9695
diff changeset
   797
    ^ myClass getPackage
02d0e21d6c67 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9695
diff changeset
   798
02d0e21d6c67 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9695
diff changeset
   799
    "Created: 15.10.1996 / 19:44:51 / cg"
02d0e21d6c67 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9695
diff changeset
   800
!
02d0e21d6c67 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9695
diff changeset
   801
5574
0fa555d3a5a9 #hasExtensions query
Claus Gittinger <cg@exept.de>
parents: 5562
diff changeset
   802
hasExtensions
0fa555d3a5a9 #hasExtensions query
Claus Gittinger <cg@exept.de>
parents: 5562
diff changeset
   803
    "return true if I have extensions"
0fa555d3a5a9 #hasExtensions query
Claus Gittinger <cg@exept.de>
parents: 5562
diff changeset
   804
0fa555d3a5a9 #hasExtensions query
Claus Gittinger <cg@exept.de>
parents: 5562
diff changeset
   805
    ^ myClass hasExtensions
0fa555d3a5a9 #hasExtensions query
Claus Gittinger <cg@exept.de>
parents: 5562
diff changeset
   806
0fa555d3a5a9 #hasExtensions query
Claus Gittinger <cg@exept.de>
parents: 5562
diff changeset
   807
!
0fa555d3a5a9 #hasExtensions query
Claus Gittinger <cg@exept.de>
parents: 5562
diff changeset
   808
5659
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5630
diff changeset
   809
hasExtensionsFrom:aPackageID
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5630
diff changeset
   810
    "return true if I have extensions from a package"
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5630
diff changeset
   811
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5630
diff changeset
   812
    ^ myClass hasExtensionsFrom:aPackageID
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5630
diff changeset
   813
!
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5630
diff changeset
   814
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1087
diff changeset
   815
isBuiltInClass
1266
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   816
    "return true if this class is known by the run-time-system.
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   817
     Here, true is returned for myself, false for subclasses."
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   818
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1087
diff changeset
   819
    ^ self == Metaclass class or:[self == Metaclass]
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1087
diff changeset
   820
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1087
diff changeset
   821
    "Created: 15.4.1996 / 17:17:34 / cg"
1266
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   822
    "Modified: 23.4.1996 / 15:59:37 / cg"
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1087
diff changeset
   823
!
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1087
diff changeset
   824
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   825
isMeta
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   826
    "return true, if the receiver is some kind of metaclass;
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   827
     true is returned here. Redefines isMeta in Object"
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   828
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   829
    ^ true
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   830
!
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   831
21607
6eefa4f76f23 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21407
diff changeset
   832
logFacility
6eefa4f76f23 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21407
diff changeset
   833
    myClass notNil ifTrue:[^ myClass logFacility ].
6eefa4f76f23 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21407
diff changeset
   834
    ^ '???'
6eefa4f76f23 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21407
diff changeset
   835
6eefa4f76f23 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21407
diff changeset
   836
    "Created: / 01-03-2017 / 10:36:50 / cg"
6eefa4f76f23 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21407
diff changeset
   837
!
6eefa4f76f23 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21407
diff changeset
   838
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   839
name
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   840
    "return my name - that is the name of my sole class, with ' class'
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   841
     appended."
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   842
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   843
    |nm|
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   844
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   845
    myClass isNil ifTrue:[
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   846
	^ #someMetaclass
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   847
    ].
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   848
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   849
    (nm := myClass name) isNil ifTrue:[
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   850
	'Metaclass [warning]: no name in my class' errorPrintCR.
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   851
	^ #'unnamed class'
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   852
    ].
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   853
    ^ nm , ' class'
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   854
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   855
    "Modified: 10.1.1997 / 17:55:08 / cg"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   856
    "Modified: 1.4.1997 / 15:53:11 / stefan"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   857
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   858
1920
6178e0048794 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1916
diff changeset
   859
nameSpace
6178e0048794 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1916
diff changeset
   860
    "return the nameSpace I am contained in.
6178e0048794 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1916
diff changeset
   861
     Due to the implementation of nameSpaces (as classVariables),
6178e0048794 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1916
diff changeset
   862
     a class can only be contained in one nameSpace (which is the desired)"
6178e0048794 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1916
diff changeset
   863
6178e0048794 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1916
diff changeset
   864
    "/ this information is in the class
6178e0048794 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1916
diff changeset
   865
6178e0048794 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1916
diff changeset
   866
    ^ myClass nameSpace
6178e0048794 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1916
diff changeset
   867
6178e0048794 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1916
diff changeset
   868
    "Created: 7.11.1996 / 13:18:52 / cg"
6178e0048794 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1916
diff changeset
   869
!
6178e0048794 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1916
diff changeset
   870
1724
ef3f680996db support for private classes
Claus Gittinger <cg@exept.de>
parents: 1698
diff changeset
   871
owningClass
ef3f680996db support for private classes
Claus Gittinger <cg@exept.de>
parents: 1698
diff changeset
   872
    "return nil here - regular metaclasses are never private"
ef3f680996db support for private classes
Claus Gittinger <cg@exept.de>
parents: 1698
diff changeset
   873
ef3f680996db support for private classes
Claus Gittinger <cg@exept.de>
parents: 1698
diff changeset
   874
    ^ nil
ef3f680996db support for private classes
Claus Gittinger <cg@exept.de>
parents: 1698
diff changeset
   875
ef3f680996db support for private classes
Claus Gittinger <cg@exept.de>
parents: 1698
diff changeset
   876
    "Created: 12.10.1996 / 20:12:16 / cg"
ef3f680996db support for private classes
Claus Gittinger <cg@exept.de>
parents: 1698
diff changeset
   877
!
ef3f680996db support for private classes
Claus Gittinger <cg@exept.de>
parents: 1698
diff changeset
   878
1757
c153e56cbcad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
   879
package
c153e56cbcad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
   880
    "return my package-id"
c153e56cbcad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
   881
c153e56cbcad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
   882
    ^ myClass package
c153e56cbcad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
   883
c153e56cbcad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
   884
    "Created: 15.10.1996 / 19:44:51 / cg"
c153e56cbcad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
   885
!
c153e56cbcad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
   886
12094
5279d6af23cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   887
soleInstance
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   888
    "return my sole class."
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   889
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   890
    ^ myClass
2047
8150a3ae6fa0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2039
diff changeset
   891
!
8150a3ae6fa0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2039
diff changeset
   892
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
   893
subclasses
12835
adf83eef0eb2 changed: #subclasses
Claus Gittinger <cg@exept.de>
parents: 12254
diff changeset
   894
    "ask my non-meta for subclasses"
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
   895
12835
adf83eef0eb2 changed: #subclasses
Claus Gittinger <cg@exept.de>
parents: 12254
diff changeset
   896
    ^ myClass subclasses collect:[:theNonMetaClass | theNonMetaClass class].
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
   897
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
   898
    "
12835
adf83eef0eb2 changed: #subclasses
Claus Gittinger <cg@exept.de>
parents: 12254
diff changeset
   899
     Integer class subclasses
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
   900
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
   901
!
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
   902
5217
3f9682e47725 added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   903
theMetaclass
9695
50d764d178d1 comment
Claus Gittinger <cg@exept.de>
parents: 9689
diff changeset
   904
    "return the metaClass of the class-meta pair.
50d764d178d1 comment
Claus Gittinger <cg@exept.de>
parents: 9689
diff changeset
   905
     Here, return myself, because I am the metaclass.
50d764d178d1 comment
Claus Gittinger <cg@exept.de>
parents: 9689
diff changeset
   906
     Also implemented in my class, which also returns me."
5217
3f9682e47725 added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   907
3f9682e47725 added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   908
    ^ self
3f9682e47725 added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   909
3f9682e47725 added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   910
    "Created: / 30.1.2000 / 23:08:15 / cg"
3f9682e47725 added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   911
    "Modified: / 31.1.2000 / 16:15:00 / cg"
3f9682e47725 added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   912
!
3f9682e47725 added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   913
3f9682e47725 added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   914
theNonMetaclass
9695
50d764d178d1 comment
Claus Gittinger <cg@exept.de>
parents: 9689
diff changeset
   915
    "return the nonMetaClass of the class-meta pair.
50d764d178d1 comment
Claus Gittinger <cg@exept.de>
parents: 9689
diff changeset
   916
     Here, return my class object, because I am the metaclass.
17592
469b9ab4d3de class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 17277
diff changeset
   917
     Also implemented in my class, which returns itself.
469b9ab4d3de class: Metaclass
Claus Gittinger <cg@exept.de>
parents: 17277
diff changeset
   918
     Sigh: ST/X naming; Squeak calls this theNonMetaClass"
5217
3f9682e47725 added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   919
3f9682e47725 added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   920
    ^ self soleInstance
3f9682e47725 added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   921
3f9682e47725 added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   922
    "Created: / 30.1.2000 / 23:08:11 / cg"
5218
603197cdcfe9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5217
diff changeset
   923
    "Modified: / 31.1.2000 / 16:17:02 / cg"
5217
3f9682e47725 added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   924
!
3f9682e47725 added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   925
2047
8150a3ae6fa0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2039
diff changeset
   926
topOwningClass
8150a3ae6fa0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2039
diff changeset
   927
    "return nil here - regular metaclasses are never private"
8150a3ae6fa0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2039
diff changeset
   928
8150a3ae6fa0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2039
diff changeset
   929
    ^ nil
8150a3ae6fa0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2039
diff changeset
   930
8150a3ae6fa0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2039
diff changeset
   931
    "Created: 3.1.1997 / 19:18:06 / cg"
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 423
diff changeset
   932
! !
621
87602c9d071c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 566
diff changeset
   933
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   934
!Metaclass methodsFor:'source management'!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   935
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   936
binaryRevision
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   937
    ^ myClass binaryRevision
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   938
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   939
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   940
     Object binaryRevision
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   941
     Object class binaryRevision
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   942
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   943
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   944
    "Modified: 2.4.1997 / 01:17:04 / stefan"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   945
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   946
13475
76bd767cfcee added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents: 13407
diff changeset
   947
binaryRevisionString
76bd767cfcee added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents: 13407
diff changeset
   948
    ^ myClass binaryRevisionString
76bd767cfcee added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents: 13407
diff changeset
   949
76bd767cfcee added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents: 13407
diff changeset
   950
    "
76bd767cfcee added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents: 13407
diff changeset
   951
     Object binaryRevisionString
76bd767cfcee added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents: 13407
diff changeset
   952
     Object class binaryRevisionString
76bd767cfcee added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents: 13407
diff changeset
   953
    "
76bd767cfcee added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents: 13407
diff changeset
   954
76bd767cfcee added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents: 13407
diff changeset
   955
    "Modified: / 02-04-1997 / 01:17:04 / stefan"
76bd767cfcee added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents: 13407
diff changeset
   956
    "Created: / 01-07-2011 / 10:55:39 / cg"
76bd767cfcee added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents: 13407
diff changeset
   957
!
76bd767cfcee added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents: 13407
diff changeset
   958
15956
28a523d61a95 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 14647
diff changeset
   959
sourceCodeManagerFromBinaryRevision
28a523d61a95 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 14647
diff changeset
   960
28a523d61a95 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 14647
diff changeset
   961
    ^ myClass sourceCodeManagerFromBinaryRevision
28a523d61a95 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 14647
diff changeset
   962
28a523d61a95 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 14647
diff changeset
   963
    "Modified: / 01-04-1997 / 14:36:31 / stefan"
28a523d61a95 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 14647
diff changeset
   964
    "Created: / 06-10-2011 / 09:34:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
28a523d61a95 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 14647
diff changeset
   965
!
28a523d61a95 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 14647
diff changeset
   966
8228
cd5c696619a3 use chunkfilewriter for fileOut
ca
parents: 7617
diff changeset
   967
sourceFileSuffix
24375
17f697620440 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24176
diff changeset
   968
    "Answers a default suffix for source files, i.e.
17f697620440 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24176
diff changeset
   969
     'st' for Smalltalk, 'js' for JavaScript or 'rb' for Ruby', etc."
17f697620440 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24176
diff changeset
   970
17f697620440 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24176
diff changeset
   971
     ^ self programmingLanguage sourceFileSuffix
13407
10be0164a8ff changed: #sourceFileSuffix
Claus Gittinger <cg@exept.de>
parents: 12835
diff changeset
   972
10be0164a8ff changed: #sourceFileSuffix
Claus Gittinger <cg@exept.de>
parents: 12835
diff changeset
   973
    "Modified: / 15-08-2009 / 22:46:44 / Jan Vrany <vranyj1@fel.cvut.cz>"
10be0164a8ff changed: #sourceFileSuffix
Claus Gittinger <cg@exept.de>
parents: 12835
diff changeset
   974
    "Modified: / 28-06-2011 / 13:44:36 / cg"
24375
17f697620440 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24176
diff changeset
   975
    "Modified (comment): / 27-06-2019 / 12:33:51 / Claus Gittinger"
8228
cd5c696619a3 use chunkfilewriter for fileOut
ca
parents: 7617
diff changeset
   976
!
cd5c696619a3 use chunkfilewriter for fileOut
ca
parents: 7617
diff changeset
   977
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   978
sourceStream
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   979
    "return the classes source stream"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   980
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   981
    ^ myClass sourceStream
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   982
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   983
    "Modified: 1.4.1997 / 14:36:31 / stefan"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   984
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   985
4780
35deaaafd9b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
   986
sourceStreamFor:sourceFileName
35deaaafd9b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
   987
    "return the sourceStream for a sourceFileName"
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   988
4780
35deaaafd9b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
   989
    ^ myClass sourceStreamFor:sourceFileName
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   990
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   991
    "Modified: 1.4.1997 / 14:36:38 / stefan"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   992
! !
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2584
diff changeset
   993
1742
e1ee359969f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1733
diff changeset
   994
!Metaclass class methodsFor:'documentation'!
639
9ff94fa31be6 version at the end
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   995
23298
b31d956df2bb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23297
diff changeset
   996
version
b31d956df2bb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23297
diff changeset
   997
    ^ '$Header$'
b31d956df2bb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23297
diff changeset
   998
!
b31d956df2bb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23297
diff changeset
   999
12102
f00d93d94de7 changed:6 methods
Claus Gittinger <cg@exept.de>
parents: 12094
diff changeset
  1000
version_CVS
18890
Stefan Vogel <sv@exept.de>
parents: 17678
diff changeset
  1001
    ^ '$Header$'
639
9ff94fa31be6 version at the end
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
  1002
! !
6824
6fbe85d05646 ...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents: 6516
diff changeset
  1003
15956
28a523d61a95 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 14647
diff changeset
  1004
2822
64829ed8f8c6 allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  1005
Metaclass initialize!