author | Claus Gittinger <cg@exept.de> |
Tue, 01 Apr 2003 12:59:23 +0200 | |
changeset 7153 | 87edd141467e |
parent 6054 | 7719f857af51 |
child 7261 | f35fc9cee675 |
permissions | -rw-r--r-- |
1 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1988 by Claus Gittinger |
159 | 3 |
All Rights Reserved |
1 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
5434 | 13 |
"{ Package: 'stx:libbasic' }" |
14 |
||
3985 | 15 |
String variableByteSubclass:#Symbol |
1020 | 16 |
instanceVariableNames:'' |
17 |
classVariableNames:'' |
|
18 |
poolDictionaries:'' |
|
19 |
category:'Collections-Text' |
|
1 | 20 |
! |
21 |
||
77 | 22 |
!Symbol class methodsFor:'documentation'! |
1 | 23 |
|
88 | 24 |
copyright |
25 |
" |
|
26 |
COPYRIGHT (c) 1988 by Claus Gittinger |
|
159 | 27 |
All Rights Reserved |
88 | 28 |
|
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
77 | 38 |
documentation |
39 |
" |
|
40 |
Symbols represent unique strings - every symbol with same printString |
|
41 |
exists exactly once in the system; Symbols are used for selectors, global |
|
345 | 42 |
variable-keys etc. Symbols can also be used to represent things which are |
43 |
enumeration type values in other programming languages (since symbols are |
|
370 | 44 |
created at compile time, comparing them using == is a fast pointer compare). |
345 | 45 |
|
46 |
A symbol may not change its characters - i.e. it is constant over its lifetime. |
|
47 |
Other than that, symbols behave much like strings. |
|
1290 | 48 |
|
49 |
[author:] |
|
2200 | 50 |
Claus Gittinger |
77 | 51 |
" |
52 |
! ! |
|
1 | 53 |
|
77 | 54 |
!Symbol class methodsFor:'instance creation'! |
1 | 55 |
|
62 | 56 |
basicNew:size |
57 |
"redefined to return a string instead of a symbol - |
|
58 |
this allows all copy methods inherited from String to |
|
59 |
return strings containing the symbols characters. |
|
1020 | 60 |
Real symbols are only created with #intern: or #asSymbol." |
62 | 61 |
|
62 |
^ String new:size |
|
1020 | 63 |
|
64 |
"Modified: 26.2.1996 / 12:51:38 / cg" |
|
62 | 65 |
! |
66 |
||
77 | 67 |
fromString:aString |
68 |
"same as intern: for Symbol, but may be used to create interned instances |
|
69 |
of subclasses. |
|
70 |
Notice: this fails, if you try to intern an instance of a subclass, AND |
|
71 |
a symbol with the same name already exists. In this case, the original |
|
72 |
symbol is returned. To use it for enum-type symbols, make certain, that the |
|
73 |
names are unique (for example by including the classes name as a prefix-string)." |
|
74 |
||
267 | 75 |
|sym len| |
77 | 76 |
|
267 | 77 |
sym := aString asSymbolIfInterned. |
78 |
sym notNil ifTrue:[ |
|
79 |
^ sym |
|
77 | 80 |
]. |
81 |
||
82 |
" |
|
83 |
create a new uninterned instance first |
|
84 |
" |
|
85 |
len := aString size. |
|
267 | 86 |
sym := super basicNew:len. |
87 |
sym replaceFrom:1 to:len with:aString. |
|
77 | 88 |
|
89 |
"now, intern it" |
|
90 |
%{ |
|
329 | 91 |
sym = __INTERNSYMBOL(sym, (OBJ *)0, __context); |
77 | 92 |
%}. |
267 | 93 |
^ sym |
77 | 94 |
! |
95 |
||
608 | 96 |
intern:aString |
97 |
"return a unique symbol with printname taken from the String-argument" |
|
98 |
||
99 |
%{ /* NOCONTEXT */ |
|
100 |
OBJ newSymbol; |
|
101 |
||
102 |
if (__isSymbol(aString)) { |
|
103 |
RETURN (aString); |
|
104 |
} |
|
105 |
if (__isString(aString)) { |
|
2200 | 106 |
newSymbol = __MKSYMBOL(__stringVal(aString), (OBJ *)0); |
608 | 107 |
if (newSymbol != nil) { |
108 |
RETURN (newSymbol); |
|
109 |
} |
|
110 |
} |
|
111 |
%}. |
|
112 |
aString class ~~ String ifTrue:[ |
|
113 |
"/ |
|
114 |
"/ only allowed to intern strings |
|
115 |
"/ |
|
116 |
^ self mustBeString |
|
117 |
]. |
|
118 |
^ ObjectMemory allocationFailureSignal raise. |
|
119 |
! |
|
120 |
||
1 | 121 |
internCharacter:aCharacter |
122 |
"return a unique symbol with printname taken from the Character-argument" |
|
123 |
||
124 |
^ self intern:(aCharacter asString) |
|
608 | 125 |
! |
126 |
||
127 |
new:size |
|
128 |
"redefined to return a string instead of a symbol - |
|
129 |
this allows all copy methods inherited from String to |
|
130 |
return strings containing the symbols characters. |
|
131 |
Real symbols are only created with intern: or asSymbol." |
|
132 |
||
133 |
^ String new:size |
|
134 |
! ! |
|
135 |
||
5185
15a129151b3b
fixed bug in storeString (must duplicate single quotes)
Claus Gittinger <cg@exept.de>
parents:
4987
diff
changeset
|
136 |
!Symbol class methodsFor:'Compatibility - ST80'! |
2570
26616a00d5aa
added #tableSize for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2565
diff
changeset
|
137 |
|
26616a00d5aa
added #tableSize for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2565
diff
changeset
|
138 |
tableSize |
26616a00d5aa
added #tableSize for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2565
diff
changeset
|
139 |
"return the size of the systems symbol table" |
26616a00d5aa
added #tableSize for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2565
diff
changeset
|
140 |
|
4838 | 141 |
"/ claus: I dont know, if the returned value should be exact. |
142 |
"/ the number below is just arbitrary ... |
|
2570
26616a00d5aa
added #tableSize for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2565
diff
changeset
|
143 |
|
26616a00d5aa
added #tableSize for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2565
diff
changeset
|
144 |
^ 10000 |
26616a00d5aa
added #tableSize for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2565
diff
changeset
|
145 |
|
26616a00d5aa
added #tableSize for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2565
diff
changeset
|
146 |
"Created: 18.4.1997 / 20:52:20 / cg" |
26616a00d5aa
added #tableSize for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2565
diff
changeset
|
147 |
! ! |
26616a00d5aa
added #tableSize for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2565
diff
changeset
|
148 |
|
608 | 149 |
!Symbol class methodsFor:'binary storage'! |
150 |
||
1253 | 151 |
binaryDefinitionFrom:stream manager:manager |
152 |
"retrieve a symbol from a binary input stream (nonpublic interface)" |
|
153 |
||
154 |
^ self intern:(super binaryDefinitionFrom:stream manager:manager) |
|
155 |
||
3086 | 156 |
"Modified: / 2.11.1997 / 16:17:06 / cg" |
1 | 157 |
! ! |
158 |
||
159 |
!Symbol class methodsFor:'queries'! |
|
160 |
||
608 | 161 |
findInterned:aString |
162 |
"for ST-80 compatibility - if the argument, aString is known |
|
163 |
as Symbol, return this symbol. Otherwise return nil." |
|
164 |
||
165 |
^ aString asSymbolIfInterned |
|
166 |
! |
|
167 |
||
168 |
hasInterned:aString |
|
169 |
"return true, if the argument, aString is known as Symbol; |
|
170 |
false otherwise" |
|
171 |
||
172 |
^ aString knownAsSymbol |
|
173 |
! |
|
174 |
||
1 | 175 |
hasInterned:aString ifTrue:trueBlock |
176 |
"for ST-80 compatibility - if the argument, aString is known |
|
177 |
as Symbol, evaluate the block with the corresponding symbol |
|
178 |
as argument and return true; otherwise return false" |
|
179 |
||
275 | 180 |
|sym| |
181 |
||
182 |
(sym := aString asSymbolIfInterned) notNil ifTrue:[ |
|
183 |
trueBlock value:sym. |
|
159 | 184 |
^ true |
1 | 185 |
]. |
186 |
^ false |
|
4651
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
187 |
! |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
188 |
|
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
189 |
hasSharedInstances |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
190 |
"return true if this class has shared instances, that is, instances |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
191 |
with the same value are identical. |
4654 | 192 |
True returned here - there is only one of each symbol (per contents)." |
4651
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
193 |
|
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
194 |
^ true |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
195 |
|
1 | 196 |
! ! |
197 |
||
7153 | 198 |
|
199 |
!Symbol methodsFor:'Compatibility - VW'! |
|
200 |
||
201 |
<< catalogID |
|
202 |
"create and return a new UserMessage, with the receiver as key, |
|
203 |
and the argument as cataglogID. |
|
204 |
VW compatibility." |
|
205 |
||
206 |
^ UserMessage key:self catalogID:catalogID |
|
207 |
||
208 |
" |
|
209 |
(#theFooMessage << #myMessages) |
|
210 |
(#theFooMessage << #myMessages >> 'cannot read subclass of metaclass') |
|
211 |
(#theFooMessage >> 'cannot read subclass of metaclass') |
|
212 |
" |
|
213 |
! |
|
214 |
||
215 |
>> aString |
|
216 |
"create and return a new UserMessage, with the receiver as key, |
|
217 |
and the argument as defaultString. |
|
218 |
VW compatibility." |
|
219 |
||
220 |
^ UserMessage key:self defaultString:aString |
|
221 |
||
222 |
" |
|
223 |
(#theFooMessage << #myMessages) |
|
224 |
(#theFooMessage << #myMessages >> 'cannot read subclass of metaclass') |
|
225 |
(#theFooMessage >> 'cannot read subclass of metaclass') |
|
226 |
" |
|
227 |
! ! |
|
228 |
||
1 | 229 |
!Symbol methodsFor:'accessing'! |
230 |
||
231 |
basicAt:index put:something |
|
345 | 232 |
"report an error if an interned symbol is about to be changed |
1219 | 233 |
- interned symbols may NOT be changed. |
234 |
For uninterned symbols, this is allowed." |
|
1 | 235 |
|
77 | 236 |
self knownAsSymbol ifTrue:[ |
4651
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
237 |
self error:'interned symbols may not be changed'. |
77 | 238 |
]. |
239 |
" |
|
240 |
uninterned - allow change |
|
241 |
" |
|
242 |
^ super basicAt:index put:something |
|
1219 | 243 |
|
244 |
"Modified: 19.4.1996 / 11:16:10 / cg" |
|
252 | 245 |
! |
246 |
||
247 |
byteAt:index put:value |
|
248 |
"report an error if interned - interned symbols may not be changed." |
|
249 |
||
250 |
^ self basicAt:index put:(value asCharacter) |
|
1 | 251 |
! ! |
252 |
||
3086 | 253 |
!Symbol methodsFor:'binary storage'! |
254 |
||
255 |
storeBinaryDefinitionOn:stream manager:manager |
|
256 |
"append a binary representation of the receiver onto stream. |
|
257 |
Redefined since short Symbol can be stored with a special type code |
|
258 |
in a more compact way. |
|
259 |
This is an internal interface for the binary storage mechanism." |
|
260 |
||
261 |
|myClass myBasicSize| |
|
262 |
||
263 |
"/ not for subclasses with named instVars. |
|
264 |
(myClass := self class) instSize ~~ 0 ifTrue:[ |
|
4651
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
265 |
^ super storeBinaryDefinitionOn:stream manager:manager |
3086 | 266 |
]. |
267 |
||
268 |
myBasicSize := self basicSize. |
|
269 |
||
270 |
"/ can use a more compact representation; |
|
271 |
"/ but not for subclasses ... |
|
272 |
||
273 |
((myClass == Symbol) |
|
274 |
and:[myBasicSize <= 255]) ifTrue:[ |
|
4651
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
275 |
"/ special encoding: <codeForSymbol> <len> <bytes> ... |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
276 |
stream nextPut:(manager codeForSymbol); nextPut:myBasicSize. |
3086 | 277 |
] ifFalse:[ |
4651
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
278 |
manager putIdOfClass:myClass on:stream. |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
279 |
stream nextNumber:4 put:myBasicSize. |
3086 | 280 |
]. |
281 |
stream nextPutBytes:myBasicSize from:self startingAt:1. |
|
282 |
||
283 |
"Modified: / 2.11.1997 / 15:28:56 / cg" |
|
284 |
"Created: / 2.11.1997 / 16:13:47 / cg" |
|
285 |
! ! |
|
286 |
||
608 | 287 |
!Symbol methodsFor:'comparing'! |
159 | 288 |
|
608 | 289 |
= something |
290 |
"return true, if the receiver and argument consist of the same characters. |
|
291 |
Redefined here, for more efficient #= comparison of symbols |
|
292 |
(which ought to be compared using #==). |
|
293 |
If the argument is a symbol, we use a quick pointer compare, instead of |
|
294 |
the inherited value compare." |
|
13 | 295 |
|
608 | 296 |
%{ /* NOCONTEXT */ |
297 |
OBJ cls; |
|
13 | 298 |
|
608 | 299 |
if (! __isNonNilObject(something)) RETURN(false); |
300 |
if ((cls = __qClass(something)) == Symbol) { |
|
301 |
RETURN (self == something ? true : false); |
|
302 |
} |
|
303 |
if (cls == String) { |
|
304 |
RETURN (strcmp(__stringVal(self), __stringVal(something)) == 0 ? true : false); |
|
345 | 305 |
} |
306 |
%}. |
|
608 | 307 |
"fall back; could be a TwoByteString, or a collection of Characters" |
1 | 308 |
|
608 | 309 |
^ super = something |
427 | 310 |
! |
311 |
||
356 | 312 |
identityHash |
313 |
"interned symbols can return a better hash key" |
|
314 |
||
315 |
%{ /* NOCONTEXT */ |
|
316 |
||
3985 | 317 |
REGISTER unsigned int g, val; |
318 |
REGISTER unsigned char *cp, *ce; |
|
356 | 319 |
int l; |
320 |
||
321 |
if (__Class(self) == Symbol) { |
|
4651
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
322 |
val = __GET_HASH(self); |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
323 |
/* |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
324 |
* only do it, if I have no standard hash key |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
325 |
* assigned (which can only happen due to a #become:, |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
326 |
* or by creating a symbol uninterned, and interning it |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
327 |
* after it got a hashKey assigned. |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
328 |
*/ |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
329 |
if (val == 0) { |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
330 |
cp = __stringVal(self); |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
331 |
l = __stringSize(self); |
356 | 332 |
|
4651
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
333 |
/* |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
334 |
* this is the dragon-book algorithm |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
335 |
* We have tested 5-bit shifts as well: |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
336 |
* |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
337 |
* ST/X Symbols: 17807 |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
338 |
* Hashkey collisions (4bit): 14 0.07% |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
339 |
* Hashkey collisions (5bit): 300 1.68% |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
340 |
*/ |
356 | 341 |
|
4651
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
342 |
if (l > 0) { |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
343 |
val = cp[0]; |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
344 |
if (l > 1) { |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
345 |
val = (val << 4) + cp[1]; |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
346 |
if (l > 2) { |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
347 |
val = (val << 4) + cp[2]; |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
348 |
if (l > 3) { |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
349 |
val = (val << 4) + cp[3]; |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
350 |
if (l > 4) { |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
351 |
val = (val << 4) + cp[4]; |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
352 |
if (l > 5) { |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
353 |
val = (val << 4) + cp[5]; |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
354 |
if (l > 6) { |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
355 |
val = (val << 4) + cp[6]; |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
356 |
for (ce = cp + l, cp += 7; cp < ce; cp++) { |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
357 |
if (g = (val & 0xF0000000)) { |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
358 |
val ^= g >> 24; |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
359 |
val ^= g; |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
360 |
} |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
361 |
val = (val << 4) + *cp; |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
362 |
} |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
363 |
} |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
364 |
} |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
365 |
} |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
366 |
} |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
367 |
} |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
368 |
} |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
369 |
} else { |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
370 |
val = 0; |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
371 |
} |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
372 |
val = (val * 31415821) & 0x3fffffff; |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
373 |
} else { |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
374 |
val = __MAKE_HASH__(val); |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
375 |
} |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
376 |
RETURN ( __MKSMALLINT(val) ); |
356 | 377 |
} |
378 |
%}. |
|
379 |
^ super identityHash |
|
3985 | 380 |
|
381 |
" |
|
4651
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
382 |
|hashColl hashSet| |
3985 | 383 |
|
4651
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
384 |
hashColl := OrderedCollection new:20000. |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
385 |
Symbol allInstancesDo:[:instance | |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
386 |
hashColl add:instance identityHash |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
387 |
]. |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
388 |
hashSet := hashColl asSet. |
3985 | 389 |
|
4651
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
390 |
Transcript showCR:'Symbols: ', hashColl size printString, |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
391 |
' unique hash keys: ', hashSet size printString, |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
392 |
' collisions:', (hashColl size - hashSet size) printString. |
3985 | 393 |
" |
394 |
||
370 | 395 |
! |
396 |
||
397 |
~= something |
|
398 |
"return true, if the receiver and argument do not consist of the same characters. |
|
399 |
Redefined here, for more efficient #~= comparison of symbols |
|
400 |
(which ought to be compared using #~~). |
|
401 |
If the argument is a symbol, we use a quick pointer compare, instead of |
|
402 |
the inherited value compare." |
|
403 |
||
404 |
%{ /* NOCONTEXT */ |
|
405 |
OBJ cls; |
|
406 |
||
379 | 407 |
if (! __isNonNilObject(something)) RETURN(true); /* cannot be equal */ |
370 | 408 |
if ((cls = __qClass(something)) == Symbol) { |
379 | 409 |
RETURN (self == something ? false : true); |
370 | 410 |
} |
411 |
if (cls == String) { |
|
379 | 412 |
RETURN (strcmp(__stringVal(self), __stringVal(something)) == 0 ? false : true); |
370 | 413 |
} |
414 |
%}. |
|
415 |
"fall back; could be a TwoByteString, or a collection of Characters" |
|
416 |
||
417 |
^ super ~= something |
|
356 | 418 |
! ! |
419 |
||
608 | 420 |
!Symbol methodsFor:'converting'! |
421 |
||
422 |
asString |
|
423 |
"return a string with printname taken from mine" |
|
424 |
||
425 |
%{ /* NOCONTEXT */ |
|
426 |
OBJ s; |
|
427 |
||
2565 | 428 |
s = __MKSTRING_ST(self); |
608 | 429 |
if (s != nil) { |
5434 | 430 |
RETURN (s); |
608 | 431 |
} |
432 |
%}. |
|
5434 | 433 |
^ (String new:(self size)) |
434 |
replaceFrom:1 with:self startingAt:1 |
|
608 | 435 |
! |
436 |
||
437 |
asSymbol |
|
438 |
"return the receiver as a symbol. |
|
439 |
Since I am a symbol - just return myself" |
|
440 |
||
441 |
^ self |
|
442 |
! |
|
443 |
||
444 |
asSymbolIfInterned |
|
445 |
"return the receiver as a symbol if there is one. |
|
446 |
Since I am a symbol - just return myself" |
|
447 |
||
448 |
^ self |
|
2416 | 449 |
! |
450 |
||
451 |
decodeAsLiteralArray |
|
452 |
"given a literalEncoding in the receiver, |
|
453 |
create & return the corresponding object. |
|
454 |
The inverse operation to #literalArrayEncoding." |
|
455 |
||
456 |
^ self |
|
457 |
||
458 |
"Created: 25.2.1997 / 19:15:26 / cg" |
|
459 |
"Modified: 25.2.1997 / 19:17:40 / cg" |
|
608 | 460 |
! ! |
461 |
||
462 |
!Symbol methodsFor:'copying'! |
|
463 |
||
464 |
copy |
|
465 |
"return a copy of myself |
|
4729 | 466 |
- reimplemented here since symbols are immutable." |
608 | 467 |
|
468 |
^ self |
|
469 |
! |
|
470 |
||
3659 | 471 |
copyReplaceAll:oldElement with:newElement |
472 |
"return a copy of the receiver as a string, where all elements equal to oldElement |
|
473 |
have been replaced by newElement." |
|
474 |
||
6054
7719f857af51
added #copyReplacing:withObject: (ANSI)
Claus Gittinger <cg@exept.de>
parents:
6001
diff
changeset
|
475 |
"/ 'Warning: #copyReplaceAll:with: will change semantics as defined in ANSI soon' errorPrintCR. |
3659 | 476 |
^ self asString replaceAll:oldElement with:newElement |
477 |
||
478 |
"Created: / 18.7.1998 / 23:03:38 / cg" |
|
479 |
! |
|
480 |
||
6054
7719f857af51
added #copyReplacing:withObject: (ANSI)
Claus Gittinger <cg@exept.de>
parents:
6001
diff
changeset
|
481 |
copyReplacing:oldElement withObject:newElement |
7719f857af51
added #copyReplacing:withObject: (ANSI)
Claus Gittinger <cg@exept.de>
parents:
6001
diff
changeset
|
482 |
"return a copy of the receiver, where all elements equal to oldElement |
7719f857af51
added #copyReplacing:withObject: (ANSI)
Claus Gittinger <cg@exept.de>
parents:
6001
diff
changeset
|
483 |
have been replaced by newElement. |
7719f857af51
added #copyReplacing:withObject: (ANSI)
Claus Gittinger <cg@exept.de>
parents:
6001
diff
changeset
|
484 |
ANSI version of what used to be #copyReplaceAll:with:" |
7719f857af51
added #copyReplacing:withObject: (ANSI)
Claus Gittinger <cg@exept.de>
parents:
6001
diff
changeset
|
485 |
|
7719f857af51
added #copyReplacing:withObject: (ANSI)
Claus Gittinger <cg@exept.de>
parents:
6001
diff
changeset
|
486 |
^ self asString replaceAll:oldElement with:newElement |
7719f857af51
added #copyReplacing:withObject: (ANSI)
Claus Gittinger <cg@exept.de>
parents:
6001
diff
changeset
|
487 |
! |
7719f857af51
added #copyReplacing:withObject: (ANSI)
Claus Gittinger <cg@exept.de>
parents:
6001
diff
changeset
|
488 |
|
608 | 489 |
deepCopy |
490 |
"return a copy of myself |
|
4729 | 491 |
- reimplemented here since symbols are immutable." |
608 | 492 |
|
493 |
^ self |
|
494 |
! |
|
495 |
||
496 |
deepCopyUsing:aDictionary |
|
497 |
"return a copy of myself |
|
4729 | 498 |
- reimplemented here since symbols are immutable." |
608 | 499 |
|
500 |
^ self |
|
501 |
! |
|
502 |
||
503 |
shallowCopy |
|
504 |
"return a copy of myself |
|
4729 | 505 |
- reimplemented here since symbols are immutable" |
608 | 506 |
|
507 |
^ self |
|
508 |
! |
|
509 |
||
510 |
simpleDeepCopy |
|
511 |
"return a copy of myself |
|
4729 | 512 |
- reimplemented here since symbols are immutable." |
608 | 513 |
|
514 |
^ self |
|
515 |
! ! |
|
516 |
||
5471
a57eeb01c5ab
General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents:
5434
diff
changeset
|
517 |
!Symbol methodsFor:'encoding'! |
a57eeb01c5ab
General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents:
5434
diff
changeset
|
518 |
|
a57eeb01c5ab
General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents:
5434
diff
changeset
|
519 |
encodeOn:anEncoder with:aParameter |
a57eeb01c5ab
General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents:
5434
diff
changeset
|
520 |
|
a57eeb01c5ab
General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents:
5434
diff
changeset
|
521 |
anEncoder encodeSymbol:self with:aParameter |
a57eeb01c5ab
General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents:
5434
diff
changeset
|
522 |
! ! |
a57eeb01c5ab
General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents:
5434
diff
changeset
|
523 |
|
608 | 524 |
!Symbol methodsFor:'printing & storing'! |
525 |
||
526 |
displayString |
|
527 |
"return a string for displaying the receiver" |
|
528 |
||
529 |
^ self storeString |
|
530 |
! |
|
531 |
||
532 |
printOn:aStream |
|
4392 | 533 |
"append a user printed representation of the receiver to aStream. |
534 |
The format is suitable for a human - not meant to be read back. |
|
535 |
||
608 | 536 |
In contrast to ST-80, this does return the symbols characters |
537 |
without any leading #. Therefore, you can directly send symbols' |
|
538 |
printStrings to some output device. This is incompatible, but easier |
|
539 |
to use." |
|
540 |
||
541 |
"/ ST-80 behavior: |
|
542 |
||
543 |
"/ self storeOn:aStream |
|
544 |
||
545 |
aStream nextPutAll:self |
|
546 |
! |
|
547 |
||
548 |
printString |
|
549 |
"return a printed representation of the receiver. |
|
550 |
In contrast to ST-80, this does return the symbols characters |
|
551 |
without any leading #. Therefore, you can directly send symbols' |
|
552 |
printStrings to some output device. This is incompatible, but easier |
|
553 |
to use." |
|
554 |
||
555 |
"/ ST-80 behavior: |
|
556 |
"/ ^ self storeString |
|
557 |
||
558 |
^ self asString |
|
559 |
! |
|
560 |
||
561 |
storeOn:aStream |
|
562 |
"store myself on a stream" |
|
563 |
||
564 |
aStream nextPutAll:(self storeString) |
|
565 |
! |
|
566 |
||
567 |
storeString |
|
568 |
"return a String for storing the receiver" |
|
569 |
||
4098 | 570 |
|sz "{Class: SmallInteger }" |
5941
e194c325bee8
storeString fixed for symbols like #'foo:bar'
Claus Gittinger <cg@exept.de>
parents:
5896
diff
changeset
|
571 |
c anyColon| |
1125 | 572 |
|
573 |
(sz := self size) > 0 ifTrue:[ "/ sigh |
|
5185
15a129151b3b
fixed bug in storeString (must duplicate single quotes)
Claus Gittinger <cg@exept.de>
parents:
4987
diff
changeset
|
574 |
(self at:1) isLetter ifTrue:[ |
5941
e194c325bee8
storeString fixed for symbols like #'foo:bar'
Claus Gittinger <cg@exept.de>
parents:
5896
diff
changeset
|
575 |
anyColon := false. |
5185
15a129151b3b
fixed bug in storeString (must duplicate single quotes)
Claus Gittinger <cg@exept.de>
parents:
4987
diff
changeset
|
576 |
2 to:sz do:[:index | |
5941
e194c325bee8
storeString fixed for symbols like #'foo:bar'
Claus Gittinger <cg@exept.de>
parents:
5896
diff
changeset
|
577 |
c := self at:index. |
e194c325bee8
storeString fixed for symbols like #'foo:bar'
Claus Gittinger <cg@exept.de>
parents:
5896
diff
changeset
|
578 |
c == $: ifTrue:[ anyColon := true ]. |
e194c325bee8
storeString fixed for symbols like #'foo:bar'
Claus Gittinger <cg@exept.de>
parents:
5896
diff
changeset
|
579 |
(c isLetterOrDigit |
5185
15a129151b3b
fixed bug in storeString (must duplicate single quotes)
Claus Gittinger <cg@exept.de>
parents:
4987
diff
changeset
|
580 |
or:[c == $: |
15a129151b3b
fixed bug in storeString (must duplicate single quotes)
Claus Gittinger <cg@exept.de>
parents:
4987
diff
changeset
|
581 |
and:[index == sz |
15a129151b3b
fixed bug in storeString (must duplicate single quotes)
Claus Gittinger <cg@exept.de>
parents:
4987
diff
changeset
|
582 |
or:[(self at:(index+1)) isLetterOrDigit]]] |
15a129151b3b
fixed bug in storeString (must duplicate single quotes)
Claus Gittinger <cg@exept.de>
parents:
4987
diff
changeset
|
583 |
) ifFalse:[ |
15a129151b3b
fixed bug in storeString (must duplicate single quotes)
Claus Gittinger <cg@exept.de>
parents:
4987
diff
changeset
|
584 |
^ '#' , super storeString |
15a129151b3b
fixed bug in storeString (must duplicate single quotes)
Claus Gittinger <cg@exept.de>
parents:
4987
diff
changeset
|
585 |
]. |
15a129151b3b
fixed bug in storeString (must duplicate single quotes)
Claus Gittinger <cg@exept.de>
parents:
4987
diff
changeset
|
586 |
]. |
5941
e194c325bee8
storeString fixed for symbols like #'foo:bar'
Claus Gittinger <cg@exept.de>
parents:
5896
diff
changeset
|
587 |
anyColon ifTrue:[ |
e194c325bee8
storeString fixed for symbols like #'foo:bar'
Claus Gittinger <cg@exept.de>
parents:
5896
diff
changeset
|
588 |
self last == $: ifFalse:[ |
e194c325bee8
storeString fixed for symbols like #'foo:bar'
Claus Gittinger <cg@exept.de>
parents:
5896
diff
changeset
|
589 |
^ '#' , super storeString |
e194c325bee8
storeString fixed for symbols like #'foo:bar'
Claus Gittinger <cg@exept.de>
parents:
5896
diff
changeset
|
590 |
] |
e194c325bee8
storeString fixed for symbols like #'foo:bar'
Claus Gittinger <cg@exept.de>
parents:
5896
diff
changeset
|
591 |
]. |
5185
15a129151b3b
fixed bug in storeString (must duplicate single quotes)
Claus Gittinger <cg@exept.de>
parents:
4987
diff
changeset
|
592 |
^ '#' , self |
15a129151b3b
fixed bug in storeString (must duplicate single quotes)
Claus Gittinger <cg@exept.de>
parents:
4987
diff
changeset
|
593 |
] |
608 | 594 |
]. |
5896 | 595 |
^ '#' , super storeString |
3285
bd5827c97b21
Do not need quotes in #storeString when a symbol contains a ':'.
Stefan Vogel <sv@exept.de>
parents:
3086
diff
changeset
|
596 |
|
3286
c6987c5f15a8
Do not need quotes in #storeString when a symbol contains a ':'.
Stefan Vogel <sv@exept.de>
parents:
3285
diff
changeset
|
597 |
" |
5896 | 598 |
#'abc' storeString |
599 |
#'abc:' storeString |
|
600 |
#'abc:def:' storeString |
|
4098 | 601 |
#'abc:def' storeString |
5896 | 602 |
#'abc::def' storeString |
603 |
#'abc &^*' storeString |
|
604 |
#'abcdef::' storeString |
|
605 |
#'hello''world' storeString |
|
606 |
#'' storeString |
|
607 |
#'''' storeString |
|
5185
15a129151b3b
fixed bug in storeString (must duplicate single quotes)
Claus Gittinger <cg@exept.de>
parents:
4987
diff
changeset
|
608 |
#'_hello' storeString |
5941
e194c325bee8
storeString fixed for symbols like #'foo:bar'
Claus Gittinger <cg@exept.de>
parents:
5896
diff
changeset
|
609 |
#'abcdef:' storeString |
e194c325bee8
storeString fixed for symbols like #'foo:bar'
Claus Gittinger <cg@exept.de>
parents:
5896
diff
changeset
|
610 |
#'abc:def:' storeString |
e194c325bee8
storeString fixed for symbols like #'foo:bar'
Claus Gittinger <cg@exept.de>
parents:
5896
diff
changeset
|
611 |
#'abc:def' storeString |
3286
c6987c5f15a8
Do not need quotes in #storeString when a symbol contains a ':'.
Stefan Vogel <sv@exept.de>
parents:
3285
diff
changeset
|
612 |
" |
c6987c5f15a8
Do not need quotes in #storeString when a symbol contains a ':'.
Stefan Vogel <sv@exept.de>
parents:
3285
diff
changeset
|
613 |
|
c6987c5f15a8
Do not need quotes in #storeString when a symbol contains a ':'.
Stefan Vogel <sv@exept.de>
parents:
3285
diff
changeset
|
614 |
"Modified: / 13.2.1998 / 22:06:15 / stefan" |
608 | 615 |
! ! |
616 |
||
617 |
!Symbol methodsFor:'queries'! |
|
618 |
||
4987 | 619 |
isInfix |
620 |
"return true, if the receiver is a binary message selector" |
|
621 |
||
622 |
^ self first isAlphaNumeric not |
|
623 |
||
624 |
" |
|
625 |
#at:put: isInfix |
|
626 |
#at: isInfix |
|
627 |
#+ isInfix |
|
628 |
#size isInfix |
|
629 |
" |
|
630 |
||
631 |
"Created: / 1.11.1997 / 12:34:55 / cg" |
|
632 |
"Modified: / 1.11.1997 / 12:36:37 / cg" |
|
633 |
! |
|
634 |
||
3086 | 635 |
isKeyword |
636 |
"return true, if the receiver is a keyword message selector" |
|
637 |
||
638 |
^ self includes:$: |
|
639 |
||
640 |
" |
|
641 |
#at:put: isKeyword |
|
642 |
#at: isKeyword |
|
643 |
#+ isKeyword |
|
644 |
#size isKeyword |
|
645 |
" |
|
646 |
||
647 |
"Created: / 1.11.1997 / 12:34:55 / cg" |
|
648 |
"Modified: / 1.11.1997 / 12:36:37 / cg" |
|
649 |
! |
|
650 |
||
608 | 651 |
isSymbol |
652 |
"return true, if the receiver is some kind of symbol. |
|
653 |
Since I am a symbol, return always true" |
|
654 |
||
655 |
^ true |
|
656 |
! |
|
657 |
||
658 |
keywords |
|
659 |
"assuming the receiver is a keyword message selector, |
|
660 |
return the individual keywords (i.e. break it up at colons) |
|
661 |
and return these as a collection. |
|
662 |
For binary and unary selectors, the result may be nonsense." |
|
663 |
||
664 |
|coll s part| |
|
665 |
||
666 |
coll := OrderedCollection new. |
|
667 |
s := ReadStream on:self. |
|
668 |
[s atEnd] whileFalse:[ |
|
669 |
part := s through:$:. |
|
670 |
coll add:part |
|
671 |
]. |
|
672 |
^ coll asArray |
|
673 |
||
674 |
" |
|
675 |
#at:put: keywords |
|
676 |
#at: keywords |
|
677 |
#+ keywords |
|
678 |
#size keywords |
|
679 |
" |
|
680 |
! |
|
681 |
||
682 |
species |
|
683 |
"when copying, or concatenating, return instances of this class" |
|
684 |
||
685 |
^ String |
|
686 |
! ! |
|
687 |
||
77 | 688 |
!Symbol methodsFor:'system primitives'! |
689 |
||
690 |
become:anotherObject |
|
691 |
"make all references to the receiver become references to anotherObject |
|
95 | 692 |
and vice-versa. For symbols, some special action is required, to |
693 |
correctly handle a become of the global dictionaries. |
|
77 | 694 |
Anyway: this is very dangerous - mysterous side-effects are to be |
95 | 695 |
expected. |
696 |
||
697 |
Notice: because of the danger here, this method may report an error |
|
159 | 698 |
in future versions" |
77 | 699 |
|
700 |
(Smalltalk includesKey:self) ifTrue:[ |
|
159 | 701 |
super become:anotherObject. |
77 | 702 |
%{ |
159 | 703 |
__rehashSystemDictionaries(); |
77 | 704 |
%}. |
705 |
] ifFalse:[ |
|
159 | 706 |
super become:anotherObject |
77 | 707 |
] |
708 |
! |
|
709 |
||
710 |
becomeNil |
|
711 |
"make all references to the receiver become nil - effectively getting |
|
95 | 712 |
rid of the receiver. For symbols, this is not allowed, if the receiver |
77 | 713 |
is used as a key in some SytemDictionary. |
95 | 714 |
This can be a very dangerous operation - be warned. |
715 |
||
716 |
Notice: because of the danger here, this method may report an error |
|
159 | 717 |
in future versions" |
77 | 718 |
|
719 |
(Smalltalk includesKey:self) ifTrue:[ |
|
159 | 720 |
self primitiveFailed |
77 | 721 |
] ifFalse:[ |
159 | 722 |
super becomeNil |
77 | 723 |
] |
724 |
! ! |
|
725 |
||
4651
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
726 |
!Symbol methodsFor:'tracing'! |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
727 |
|
4682 | 728 |
traceInto:aRequestor level:level from:referrer |
4651
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
729 |
"double dispatch into tracer, passing my type implicitely in the selector" |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
730 |
|
4682 | 731 |
^ aRequestor traceSymbol:self level:level from:referrer |
4651
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
732 |
|
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
733 |
|
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
734 |
! ! |
18a6ac30b36f
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4530
diff
changeset
|
735 |
|
632 | 736 |
!Symbol class methodsFor:'documentation'! |
737 |
||
738 |
version |
|
7153 | 739 |
^ '$Header: /cvs/stx/stx/libbasic/Symbol.st,v 1.70 2003-04-01 10:59:23 cg Exp $' |
632 | 740 |
! ! |