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