author | Claus Gittinger <cg@exept.de> |
Fri, 03 Sep 1999 17:36:50 +0200 | |
changeset 953 | e863f0860a7e |
parent 945 | a42d24a15c84 |
child 1037 | 6c3b1d28ae03 |
permissions | -rw-r--r-- |
283 | 1 |
" |
2 |
COPYRIGHT (c) 1996 by Claus Gittinger |
|
3 |
All Rights Reserved |
|
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 |
||
282 | 13 |
Object subclass:#Structure |
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
14 |
instanceVariableNames:'superclass flags methodDictionary otherSupers instSize i1 i2 i3 |
343 | 15 |
i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 i16 i17 i18 i19 i20 i21 |
16 |
i22 i23 i24 i25 i26 i27 i28 i29 i30 i31 i32 i33 i34 i35 i36 i37 |
|
17 |
i38 i39 i40 i41 i42 i43 i44 i45 i46 i47 i48 i49 i50' |
|
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
18 |
classVariableNames:'OneInstance DummyClass ReadAccessMethods WriteAccessMethods |
616 | 19 |
OtherMethods OtherSelectors' |
282 | 20 |
poolDictionaries:'' |
283 | 21 |
category:'Programming-Support' |
282 | 22 |
! |
23 |
||
616 | 24 |
!Structure class methodsFor:'documentation'! |
282 | 25 |
|
283 | 26 |
copyright |
27 |
" |
|
28 |
COPYRIGHT (c) 1996 by Claus Gittinger |
|
29 |
All Rights Reserved |
|
30 |
||
31 |
This software is furnished under a license and may be used |
|
32 |
only in accordance with the terms of that license and with the |
|
33 |
inclusion of the above copyright notice. This software may not |
|
34 |
be provided or otherwise made available to, or used by, any |
|
35 |
other person. No title to or ownership of the software is |
|
36 |
hereby transferred. |
|
37 |
" |
|
38 |
! |
|
39 |
||
282 | 40 |
documentation |
41 |
" |
|
616 | 42 |
This is an experimental class, stressing the metaObject capabilities. |
282 | 43 |
|
616 | 44 |
Structures are objects which are class-less, |
45 |
only holding some values, and provide a protocol to access |
|
46 |
those fields. In addition, they support the array-protocol, |
|
47 |
so they can be used as backward compatible replacements in |
|
282 | 48 |
places where arrays were returned. |
616 | 49 |
(However, we recommend using private classes, since they are easier |
50 |
to understand and aintain). |
|
51 |
||
52 |
For example, some structure object can be create with: |
|
53 |
^ Structure with:#foo->'someFooValue' with:#bar->'someBarValue' |
|
282 | 54 |
|
55 |
and access these values either as: |
|
616 | 56 |
retVal at:1 -> returns the foo instvar value |
57 |
retVal at:2 -> returns the bar instvar value |
|
282 | 58 |
or (much more convenient and readable) as: |
616 | 59 |
retVal foo |
60 |
retVal bar |
|
282 | 61 |
|
616 | 62 |
Implementation note: |
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
63 |
this is a very tricky (but fully legal) implementation, |
616 | 64 |
creating an object which is its own class. |
65 |
Therefore, no additional overhead by extra (class) objects is involved. |
|
66 |
These are very lightweight objects. |
|
67 |
||
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
68 |
Another prove that smalltalk is a powerful & flexible programming language. |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
69 |
However, some smalltalk systems crash if your try this ;-) |
282 | 70 |
|
343 | 71 |
CAVEAT: |
616 | 72 |
tricky implementation - not the full object protocol is supported; |
343 | 73 |
a maximum of 50 instance variables is allowed. |
74 |
||
616 | 75 |
[WARNING:] |
76 |
this is an experimental goody - for our amusement and not meant |
|
77 |
to be used in real applications. |
|
78 |
It may be removed without notice and/or no longer maintained in the furure. |
|
79 |
||
282 | 80 |
[author:] |
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
81 |
Claus Gittinger |
282 | 82 |
|
83 |
[see also:] |
|
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
84 |
Array |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
85 |
Behavior |
282 | 86 |
" |
87 |
! |
|
88 |
||
89 |
examples |
|
90 |
" |
|
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
91 |
access is possibly by name: |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
92 |
[exBegin] |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
93 |
Transcript showCR: |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
94 |
(Structure with:#foo->'foo value') foo |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
95 |
[exEnd] |
282 | 96 |
|
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
97 |
AND also by index (for backward compatibility): |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
98 |
[exBegin] |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
99 |
Transcript showCR: |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
100 |
((Structure with:#foo->'foo value') at:1) |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
101 |
[exEnd] |
282 | 102 |
|
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
103 |
it can be inspected: |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
104 |
[exBegin] |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
105 |
(Structure with:#foo->'foo value') inspect |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
106 |
[exEnd] |
282 | 107 |
|
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
108 |
and presents its contents nicely: |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
109 |
[exBegin] |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
110 |
(Structure with:#foo->'foo value' with:#bar->'bar value') inspect |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
111 |
[exEnd] |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
112 |
|
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
113 |
[exBegin] |
282 | 114 |
(Structure with:#foo->'hello' with:#bar->true with:#baz->'world') inspect |
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
115 |
[exEnd] |
282 | 116 |
|
117 |
" |
|
118 |
! ! |
|
119 |
||
616 | 120 |
!Structure class methodsFor:'initialization'! |
282 | 121 |
|
122 |
initialize |
|
123 |
OneInstance isNil ifTrue:[ |
|
124 |
OneInstance := self basicNew. |
|
125 |
||
126 |
DummyClass := Behavior shallowCopy. |
|
127 |
DummyClass flags:(Behavior flagBehavior bitOr:Behavior flagPointers). |
|
953 | 128 |
DummyClass setName:#DummyClass. |
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
129 |
|
343 | 130 |
ReadAccessMethods := (1 to:50) |
616 | 131 |
collect:[:i | |m| |
132 |
m := self compiledMethodAt:('i', i printString) asSymbol. |
|
133 |
(m notNil and:[m isLazyMethod]) ifTrue:[m makeRealMethod]. |
|
134 |
m |
|
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
135 |
]. |
343 | 136 |
WriteAccessMethods := (1 to:50) |
616 | 137 |
collect:[:i | |m| |
138 |
m := self compiledMethodAt:('i', i printString , ':') asSymbol. |
|
139 |
(m notNil and:[m isLazyMethod]) ifTrue:[m makeRealMethod]. |
|
140 |
m |
|
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
141 |
]. |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
142 |
|
616 | 143 |
OtherMethods := OrderedCollection new. |
144 |
OtherMethods |
|
145 |
add:(self compiledMethodAt:#doesNotUnderstand:); |
|
146 |
add:(Object compiledMethodAt:#class); |
|
147 |
add:(Object compiledMethodAt:#identityHash); |
|
148 |
add:(Object compiledMethodAt:#at:); |
|
149 |
add:(Object compiledMethodAt:#at:put:); |
|
150 |
add:(Object compiledMethodAt:#basicAt:); |
|
151 |
add:(Object compiledMethodAt:#basicAt:put:); |
|
152 |
add:(Object compiledMethodAt:#printString); |
|
153 |
add:(Object compiledMethodAt:#printOn:); |
|
154 |
add:(Object compiledMethodAt:#addDependent:); |
|
155 |
add:(Object compiledMethodAt:#removeDependent:); |
|
156 |
add:(Object compiledMethodAt:#dependents); |
|
157 |
add:(Object compiledMethodAt:#dependents:); |
|
158 |
add:(Object compiledMethodAt:#perform:); |
|
159 |
add:(Object compiledMethodAt:#perform:with:). |
|
160 |
OtherMethods := OtherMethods asArray. |
|
161 |
||
162 |
OtherSelectors := #(#doesNotUnderstand: |
|
163 |
#class #identityHash |
|
164 |
#at: #at:put: #basicAt: #basicAt:put: |
|
165 |
#printString #printOn: |
|
166 |
#addDependent: #removeDependent: #dependents #dependents: |
|
167 |
#perform: #perform:with:). |
|
282 | 168 |
]. |
169 |
||
170 |
" |
|
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
171 |
OneInstance := nil. |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
172 |
self initialize. |
282 | 173 |
" |
174 |
||
343 | 175 |
"Modified: 21.9.1996 / 16:01:48 / cg" |
282 | 176 |
! ! |
177 |
||
616 | 178 |
!Structure class methodsFor:'instance creation'! |
282 | 179 |
|
180 |
newWith:names |
|
181 |
"return a new structure containing fields as passed in the names collection. |
|
182 |
The argument must be a sequenceable collection of symbols. |
|
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
183 |
The new structures values are all initialized to nil." |
282 | 184 |
|
185 |
^ self newWith:names values:nil |
|
186 |
||
187 |
" |
|
188 |
Structure newWith:#(foo bar) |
|
189 |
" |
|
190 |
||
191 |
"Created: 13.5.1996 / 20:03:42 / cg" |
|
192 |
! |
|
193 |
||
194 |
newWith:names values:values |
|
195 |
"return a new structure containing fields as passed in the names collection. |
|
196 |
The argument must be a sequenceable collection of symbols. |
|
197 |
The new structures values are set to corresponding values from the second argument, values." |
|
198 |
||
654 | 199 |
|arr sels mthds nInsts| |
616 | 200 |
|
201 |
nInsts := names size. |
|
282 | 202 |
|
203 |
sels := names collect:[:nm | nm asSymbol]. |
|
204 |
sels := sels , (names collect:[:nm | (nm , ':') asSymbol]). |
|
616 | 205 |
sels := sels , OtherSelectors. |
282 | 206 |
|
616 | 207 |
mthds := ReadAccessMethods copyTo:nInsts. |
208 |
mthds := mthds , (WriteAccessMethods copyTo:nInsts). |
|
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
209 |
mthds := mthds , OtherMethods. |
282 | 210 |
|
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
211 |
"/ create a prototype object as an array ... |
616 | 212 |
"/ the object will be its own class, and have the indexable flag bit set; |
213 |
"/ therefore, the first 5 instVars must correspond to Behavior instvars, |
|
214 |
"/ the remaining ones will be the indexed instvars. |
|
282 | 215 |
|
616 | 216 |
arr := Array new:(nInsts + 5). |
282 | 217 |
arr at:1 put:nil. "/ superclass |
218 |
arr at:2 put:(Behavior flagBehavior bitOr:Behavior flagPointers). "/ flags |
|
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
219 |
arr at:3 put:(MethodDictionary withKeys:sels andValues:mthds). "/ selectors & methods |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
220 |
arr at:4 put:nil. "/ other supers |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
221 |
arr at:5 put:5. "/ instSize |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
222 |
|
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
223 |
"/ now, the big trick ... |
282 | 224 |
|
225 |
arr changeClassTo:DummyClass. |
|
226 |
arr changeClassTo:arr. |
|
227 |
||
228 |
values notNil ifTrue:[ |
|
229 |
values keysAndValuesDo:[:i :val | |
|
230 |
arr at:i put:val |
|
231 |
] |
|
232 |
]. |
|
233 |
||
234 |
^ arr. |
|
235 |
||
236 |
" |
|
237 |
Structure newWith:#(foo bar) values:#('foo' 'bar') |
|
238 |
" |
|
239 |
||
240 |
"Created: 13.5.1996 / 20:03:42 / cg" |
|
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
241 |
"Modified: 3.7.1996 / 10:24:43 / cg" |
282 | 242 |
! |
243 |
||
244 |
with:assoc |
|
245 |
"return a new structure with a single field, named to the assocs key, |
|
246 |
and initialized with assocs value." |
|
247 |
||
248 |
^ self newWith:(Array with:assoc key) values:(Array with:assoc value) |
|
249 |
||
250 |
" |
|
251 |
Structure with:#foo->'foo' |
|
252 |
" |
|
253 |
! |
|
254 |
||
255 |
with:assoc1 with:assoc2 |
|
256 |
"return a new structure with two fields, named as defined by the arguments' |
|
257 |
keys, and and initialized with the assocs' values." |
|
258 |
||
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
259 |
^ self newWith:(Array with:assoc1 key with:assoc2 key) |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
260 |
values:(Array with:assoc1 value with:assoc2 value) |
282 | 261 |
|
262 |
" |
|
263 |
Structure with:#foo->'foo' with:#bar->'bar' |
|
264 |
" |
|
265 |
! |
|
266 |
||
267 |
with:assoc1 with:assoc2 with:assoc3 |
|
268 |
"return a new structure with three fields, named as defined by the arguments' |
|
269 |
keys, and and initialized with the assocs' values." |
|
270 |
||
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
271 |
^ self newWith:(Array with:assoc1 key with:assoc2 key with:assoc3 key) |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
272 |
values:(Array with:assoc1 value with:assoc2 value with:assoc3 value) |
282 | 273 |
|
274 |
" |
|
275 |
Structure with:#foo->'foo' with:#bar->'bar' with:#baz->'baz' |
|
276 |
" |
|
277 |
! |
|
278 |
||
279 |
with:assoc1 with:assoc2 with:assoc3 with:assoc4 |
|
280 |
"return a new structure with four fields, named as defined by the arguments' |
|
281 |
keys, and and initialized with the assocs' values." |
|
282 |
||
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
283 |
^ self newWith:(Array with:assoc1 key with:assoc2 key |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
284 |
with:assoc3 key with:assoc4 key) |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
285 |
values:(Array with:assoc1 value with:assoc2 value |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
286 |
with:assoc3 value with:assoc4 value) |
282 | 287 |
|
288 |
" |
|
289 |
Structure with:#foo->'foo' with:#bar->'bar' with:#baz->'baz' with:#hello->'hello' |
|
290 |
" |
|
291 |
! |
|
292 |
||
293 |
with:assoc1 with:assoc2 with:assoc3 with:assoc4 with:assoc5 |
|
294 |
"return a new structure with five fields, named as defined by the arguments' |
|
295 |
keys, and and initialized with the assocs' values." |
|
296 |
||
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
297 |
^ self newWith:(Array with:assoc1 key with:assoc2 key |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
298 |
with:assoc3 key with:assoc4 key |
282 | 299 |
with:assoc5 key) |
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
300 |
values:(Array with:assoc1 value with:assoc2 value |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
301 |
with:assoc3 value with:assoc4 value |
282 | 302 |
with:assoc5 value) |
303 |
||
304 |
" |
|
305 |
Structure with:#foo->'foo' with:#bar->'bar' with:#baz->'baz' with:#hello->'hello' with:#world->'world' |
|
306 |
" |
|
307 |
! ! |
|
308 |
||
616 | 309 |
!Structure class methodsFor:'special'! |
310 |
||
311 |
primAddSelector:newSelector withMethod:newMethod |
|
312 |
"must reinit myself when methods are accepted." |
|
313 |
||
314 |
|val| |
|
315 |
||
316 |
val := super primAddSelector:newSelector withMethod:newMethod. |
|
317 |
OneInstance := nil. |
|
318 |
self initialize. |
|
319 |
^ val |
|
320 |
! ! |
|
321 |
||
282 | 322 |
!Structure methodsFor:'accessing'! |
323 |
||
324 |
flags |
|
325 |
"return the flags - required class protocol" |
|
326 |
||
327 |
^ flags |
|
328 |
||
329 |
"Created: 13.5.1996 / 21:19:23 / cg" |
|
330 |
! |
|
331 |
||
332 |
flags:something |
|
333 |
"set the flags - required class protocol" |
|
334 |
||
335 |
flags := something. |
|
336 |
||
337 |
"Created: 13.5.1996 / 21:19:23 / cg" |
|
338 |
! |
|
339 |
||
340 |
i1 |
|
616 | 341 |
"prototype method to return the first instance variable" |
282 | 342 |
|
343 |
^ i1 |
|
344 |
||
345 |
"Created: 13.5.1996 / 21:19:25 / cg" |
|
346 |
! |
|
347 |
||
348 |
i10 |
|
616 | 349 |
"prototype method to return the 10th instance variable" |
282 | 350 |
|
351 |
^ i10 |
|
352 |
||
353 |
"Created: 13.5.1996 / 21:19:27 / cg" |
|
354 |
! |
|
355 |
||
356 |
i10:something |
|
616 | 357 |
"prototype method to set the 10th instance variable" |
282 | 358 |
|
359 |
i10 := something. |
|
360 |
||
361 |
"Created: 13.5.1996 / 21:19:27 / cg" |
|
362 |
! |
|
363 |
||
364 |
i11 |
|
365 |
"return i11" |
|
366 |
||
367 |
^ i11 |
|
368 |
||
369 |
"Created: 13.5.1996 / 21:19:27 / cg" |
|
370 |
! |
|
371 |
||
372 |
i11:something |
|
616 | 373 |
"prototype method to set the 11th instance variable" |
282 | 374 |
|
375 |
i11 := something. |
|
376 |
||
377 |
"Created: 13.5.1996 / 21:19:27 / cg" |
|
378 |
! |
|
379 |
||
380 |
i12 |
|
381 |
"return i12" |
|
382 |
||
383 |
^ i12 |
|
384 |
||
385 |
"Created: 13.5.1996 / 21:19:27 / cg" |
|
386 |
! |
|
387 |
||
388 |
i12:something |
|
389 |
"set i12" |
|
390 |
||
391 |
i12 := something. |
|
392 |
||
393 |
"Created: 13.5.1996 / 21:19:27 / cg" |
|
394 |
! |
|
395 |
||
396 |
i13 |
|
397 |
"return i13" |
|
398 |
||
399 |
^ i13 |
|
400 |
||
401 |
"Created: 13.5.1996 / 21:19:28 / cg" |
|
402 |
! |
|
403 |
||
404 |
i13:something |
|
405 |
"set i13" |
|
406 |
||
407 |
i13 := something. |
|
408 |
||
409 |
"Created: 13.5.1996 / 21:19:28 / cg" |
|
410 |
! |
|
411 |
||
412 |
i14 |
|
413 |
"return i14" |
|
414 |
||
415 |
^ i14 |
|
416 |
||
417 |
"Created: 13.5.1996 / 21:19:28 / cg" |
|
418 |
! |
|
419 |
||
420 |
i14:something |
|
421 |
"set i14" |
|
422 |
||
423 |
i14 := something. |
|
424 |
||
425 |
"Created: 13.5.1996 / 21:19:28 / cg" |
|
426 |
! |
|
427 |
||
428 |
i15 |
|
429 |
"return i15" |
|
430 |
||
431 |
^ i15 |
|
432 |
||
433 |
"Created: 13.5.1996 / 21:19:28 / cg" |
|
434 |
! |
|
435 |
||
436 |
i15:something |
|
437 |
"set i15" |
|
438 |
||
439 |
i15 := something. |
|
440 |
||
441 |
"Created: 13.5.1996 / 21:19:28 / cg" |
|
442 |
! |
|
443 |
||
444 |
i16 |
|
445 |
"return i16" |
|
446 |
||
447 |
^ i16 |
|
448 |
||
449 |
"Created: 13.5.1996 / 21:19:28 / cg" |
|
450 |
! |
|
451 |
||
452 |
i16:something |
|
453 |
"set i16" |
|
454 |
||
455 |
i16 := something. |
|
456 |
||
457 |
"Created: 13.5.1996 / 21:19:28 / cg" |
|
458 |
! |
|
459 |
||
460 |
i17 |
|
461 |
"return i17" |
|
462 |
||
463 |
^ i17 |
|
464 |
||
465 |
"Created: 13.5.1996 / 21:19:28 / cg" |
|
466 |
! |
|
467 |
||
468 |
i17:something |
|
469 |
"set i17" |
|
470 |
||
471 |
i17 := something. |
|
472 |
||
473 |
"Created: 13.5.1996 / 21:19:29 / cg" |
|
474 |
! |
|
475 |
||
476 |
i18 |
|
477 |
"return i18" |
|
478 |
||
479 |
^ i18 |
|
480 |
||
481 |
"Created: 13.5.1996 / 21:19:29 / cg" |
|
482 |
! |
|
483 |
||
484 |
i18:something |
|
485 |
"set i18" |
|
486 |
||
487 |
i18 := something. |
|
488 |
||
489 |
"Created: 13.5.1996 / 21:19:29 / cg" |
|
490 |
! |
|
491 |
||
492 |
i19 |
|
493 |
"return i19" |
|
494 |
||
495 |
^ i19 |
|
496 |
||
497 |
"Created: 13.5.1996 / 21:19:29 / cg" |
|
498 |
! |
|
499 |
||
500 |
i19:something |
|
501 |
"set i19" |
|
502 |
||
503 |
i19 := something. |
|
504 |
||
505 |
"Created: 13.5.1996 / 21:19:29 / cg" |
|
506 |
! |
|
507 |
||
508 |
i1:something |
|
616 | 509 |
"prototype method to set the 1st instance variable" |
282 | 510 |
|
511 |
i1 := something. |
|
512 |
||
513 |
"Created: 13.5.1996 / 21:19:25 / cg" |
|
514 |
! |
|
515 |
||
516 |
i2 |
|
616 | 517 |
"prototype method to return the 2nd instance variable" |
282 | 518 |
|
519 |
^ i2 |
|
520 |
||
521 |
"Created: 13.5.1996 / 21:19:25 / cg" |
|
522 |
! |
|
523 |
||
524 |
i20 |
|
525 |
"return i20" |
|
526 |
||
527 |
^ i20 |
|
528 |
||
529 |
"Created: 13.5.1996 / 21:19:29 / cg" |
|
530 |
! |
|
531 |
||
532 |
i20:something |
|
533 |
"set i20" |
|
534 |
||
535 |
i20 := something. |
|
536 |
||
537 |
"Created: 13.5.1996 / 21:19:29 / cg" |
|
538 |
! |
|
539 |
||
343 | 540 |
i21 |
541 |
"return i21" |
|
542 |
||
543 |
^ i21 |
|
544 |
||
545 |
"Created: 21.9.1996 / 16:06:21 / cg" |
|
546 |
! |
|
547 |
||
548 |
i21:something |
|
549 |
"set i21" |
|
550 |
||
551 |
i21 := something. |
|
552 |
||
553 |
"Created: 21.9.1996 / 16:06:21 / cg" |
|
554 |
! |
|
555 |
||
556 |
i22 |
|
557 |
"return i22" |
|
558 |
||
559 |
^ i22 |
|
560 |
||
561 |
"Created: 21.9.1996 / 16:06:21 / cg" |
|
562 |
! |
|
563 |
||
564 |
i22:something |
|
565 |
"set i22" |
|
566 |
||
567 |
i22 := something. |
|
568 |
||
569 |
"Created: 21.9.1996 / 16:06:21 / cg" |
|
570 |
! |
|
571 |
||
572 |
i23 |
|
573 |
"return i23" |
|
574 |
||
575 |
^ i23 |
|
576 |
||
577 |
"Created: 21.9.1996 / 16:06:21 / cg" |
|
578 |
! |
|
579 |
||
580 |
i23:something |
|
581 |
"set i23" |
|
582 |
||
583 |
i23 := something. |
|
584 |
||
585 |
"Created: 21.9.1996 / 16:06:21 / cg" |
|
586 |
! |
|
587 |
||
588 |
i24 |
|
589 |
"return i24" |
|
590 |
||
591 |
^ i24 |
|
592 |
||
593 |
"Created: 21.9.1996 / 16:06:21 / cg" |
|
594 |
! |
|
595 |
||
596 |
i24:something |
|
597 |
"set i24" |
|
598 |
||
599 |
i24 := something. |
|
600 |
||
601 |
"Created: 21.9.1996 / 16:06:21 / cg" |
|
602 |
! |
|
603 |
||
604 |
i25 |
|
605 |
"return i25" |
|
606 |
||
607 |
^ i25 |
|
608 |
||
609 |
"Created: 21.9.1996 / 16:06:21 / cg" |
|
610 |
! |
|
611 |
||
612 |
i25:something |
|
613 |
"set i25" |
|
614 |
||
615 |
i25 := something. |
|
616 |
||
617 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
618 |
! |
|
619 |
||
620 |
i26 |
|
621 |
"return i26" |
|
622 |
||
623 |
^ i26 |
|
624 |
||
625 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
626 |
! |
|
627 |
||
628 |
i26:something |
|
629 |
"set i26" |
|
630 |
||
631 |
i26 := something. |
|
632 |
||
633 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
634 |
! |
|
635 |
||
636 |
i27 |
|
637 |
"return i27" |
|
638 |
||
639 |
^ i27 |
|
640 |
||
641 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
642 |
! |
|
643 |
||
644 |
i27:something |
|
645 |
"set i27" |
|
646 |
||
647 |
i27 := something. |
|
648 |
||
649 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
650 |
! |
|
651 |
||
652 |
i28 |
|
653 |
"return i28" |
|
654 |
||
655 |
^ i28 |
|
656 |
||
657 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
658 |
! |
|
659 |
||
660 |
i28:something |
|
661 |
"set i28" |
|
662 |
||
663 |
i28 := something. |
|
664 |
||
665 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
666 |
! |
|
667 |
||
668 |
i29 |
|
669 |
"return i29" |
|
670 |
||
671 |
^ i29 |
|
672 |
||
673 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
674 |
! |
|
675 |
||
676 |
i29:something |
|
677 |
"set i29" |
|
678 |
||
679 |
i29 := something. |
|
680 |
||
681 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
682 |
! |
|
683 |
||
282 | 684 |
i2:something |
616 | 685 |
"prototype method to set the 2nd instance variable" |
282 | 686 |
|
687 |
i2 := something. |
|
688 |
||
689 |
"Created: 13.5.1996 / 21:19:25 / cg" |
|
690 |
! |
|
691 |
||
692 |
i3 |
|
616 | 693 |
"prototype method to return the 3rd instance variable" |
282 | 694 |
|
695 |
^ i3 |
|
696 |
||
697 |
"Created: 13.5.1996 / 21:19:25 / cg" |
|
698 |
! |
|
699 |
||
343 | 700 |
i30:something |
701 |
"set i30" |
|
702 |
||
703 |
i30 := something. |
|
704 |
||
705 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
706 |
! |
|
707 |
||
708 |
i31 |
|
709 |
"return i31" |
|
710 |
||
711 |
^ i31 |
|
712 |
||
713 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
714 |
! |
|
715 |
||
716 |
i31:something |
|
717 |
"set i31" |
|
718 |
||
719 |
i31 := something. |
|
720 |
||
721 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
722 |
! |
|
723 |
||
724 |
i32 |
|
725 |
"return i32" |
|
726 |
||
727 |
^ i32 |
|
728 |
||
729 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
730 |
! |
|
731 |
||
732 |
i32:something |
|
733 |
"set i32" |
|
734 |
||
735 |
i32 := something. |
|
736 |
||
737 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
738 |
! |
|
739 |
||
740 |
i33 |
|
741 |
"return i33" |
|
742 |
||
743 |
^ i33 |
|
744 |
||
745 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
746 |
! |
|
747 |
||
748 |
i33:something |
|
749 |
"set i33" |
|
750 |
||
751 |
i33 := something. |
|
752 |
||
753 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
754 |
! |
|
755 |
||
756 |
i34 |
|
757 |
"return i34" |
|
758 |
||
759 |
^ i34 |
|
760 |
||
761 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
762 |
! |
|
763 |
||
764 |
i34:something |
|
765 |
"set i34" |
|
766 |
||
767 |
i34 := something. |
|
768 |
||
769 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
770 |
! |
|
771 |
||
772 |
i35 |
|
773 |
"return i35" |
|
774 |
||
775 |
^ i35 |
|
776 |
||
777 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
778 |
! |
|
779 |
||
780 |
i35:something |
|
781 |
"set i35" |
|
782 |
||
783 |
i35 := something. |
|
784 |
||
785 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
786 |
! |
|
787 |
||
788 |
i36 |
|
789 |
"return i36" |
|
790 |
||
791 |
^ i36 |
|
792 |
||
793 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
794 |
! |
|
795 |
||
796 |
i36:something |
|
797 |
"set i36" |
|
798 |
||
799 |
i36 := something. |
|
800 |
||
801 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
802 |
! |
|
803 |
||
804 |
i37 |
|
805 |
"return i37" |
|
806 |
||
807 |
^ i37 |
|
808 |
||
809 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
810 |
! |
|
811 |
||
812 |
i37:something |
|
813 |
"set i37" |
|
814 |
||
815 |
i37 := something. |
|
816 |
||
817 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
818 |
! |
|
819 |
||
820 |
i38 |
|
821 |
"return i38" |
|
822 |
||
823 |
^ i38 |
|
824 |
||
825 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
826 |
! |
|
827 |
||
828 |
i38:something |
|
829 |
"set i38" |
|
830 |
||
831 |
i38 := something. |
|
832 |
||
833 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
834 |
! |
|
835 |
||
836 |
i39 |
|
837 |
"return i39" |
|
838 |
||
839 |
^ i39 |
|
840 |
||
841 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
842 |
! |
|
843 |
||
844 |
i39:something |
|
845 |
"set i39" |
|
846 |
||
847 |
i39 := something. |
|
848 |
||
849 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
850 |
! |
|
851 |
||
282 | 852 |
i3:something |
616 | 853 |
"prototype method to set the 3rd instance variable" |
282 | 854 |
|
855 |
i3 := something. |
|
856 |
||
857 |
"Created: 13.5.1996 / 21:19:25 / cg" |
|
858 |
! |
|
859 |
||
860 |
i4 |
|
616 | 861 |
"prototype method to return the 4th instance variable" |
282 | 862 |
|
863 |
^ i4 |
|
864 |
||
865 |
"Created: 13.5.1996 / 21:19:25 / cg" |
|
866 |
! |
|
867 |
||
616 | 868 |
i40 |
869 |
"return the value of the instance variable 'i40' (automatically generated)" |
|
870 |
||
871 |
^ i40! |
|
872 |
||
343 | 873 |
i40:something |
616 | 874 |
"prototype method" |
343 | 875 |
|
876 |
i40 := something. |
|
877 |
||
878 |
"Created: 21.9.1996 / 16:06:22 / cg" |
|
879 |
! |
|
880 |
||
881 |
i41 |
|
616 | 882 |
"prototype method" |
343 | 883 |
|
884 |
^ i41 |
|
885 |
||
886 |
"Created: 21.9.1996 / 16:06:23 / cg" |
|
887 |
! |
|
888 |
||
889 |
i41:something |
|
616 | 890 |
"prototype method" |
343 | 891 |
|
892 |
i41 := something. |
|
893 |
||
894 |
"Created: 21.9.1996 / 16:06:23 / cg" |
|
895 |
! |
|
896 |
||
897 |
i42 |
|
616 | 898 |
"prototype method" |
343 | 899 |
|
900 |
^ i42 |
|
901 |
||
902 |
"Created: 21.9.1996 / 16:06:23 / cg" |
|
903 |
! |
|
904 |
||
905 |
i42:something |
|
616 | 906 |
"prototype method" |
343 | 907 |
|
908 |
i42 := something. |
|
909 |
||
910 |
"Created: 21.9.1996 / 16:06:23 / cg" |
|
911 |
! |
|
912 |
||
913 |
i43 |
|
616 | 914 |
"prototype method" |
343 | 915 |
|
916 |
^ i43 |
|
917 |
||
918 |
"Created: 21.9.1996 / 16:06:23 / cg" |
|
919 |
! |
|
920 |
||
921 |
i43:something |
|
616 | 922 |
"prototype method" |
343 | 923 |
|
924 |
i43 := something. |
|
925 |
||
926 |
"Created: 21.9.1996 / 16:06:23 / cg" |
|
927 |
! |
|
928 |
||
929 |
i44 |
|
616 | 930 |
"prototype method" |
343 | 931 |
|
932 |
^ i44 |
|
933 |
||
934 |
"Created: 21.9.1996 / 16:06:23 / cg" |
|
935 |
! |
|
936 |
||
937 |
i44:something |
|
616 | 938 |
"prototype method" |
343 | 939 |
|
940 |
i44 := something. |
|
941 |
||
942 |
"Created: 21.9.1996 / 16:06:23 / cg" |
|
943 |
! |
|
944 |
||
945 |
i45 |
|
616 | 946 |
"prototype method" |
343 | 947 |
|
948 |
^ i45 |
|
949 |
||
950 |
"Created: 21.9.1996 / 16:06:23 / cg" |
|
951 |
! |
|
952 |
||
953 |
i45:something |
|
616 | 954 |
"prototype method" |
343 | 955 |
|
956 |
i45 := something. |
|
957 |
||
958 |
"Created: 21.9.1996 / 16:06:23 / cg" |
|
959 |
! |
|
960 |
||
961 |
i46 |
|
616 | 962 |
"prototype method" |
343 | 963 |
|
964 |
^ i46 |
|
965 |
||
966 |
"Created: 21.9.1996 / 16:06:23 / cg" |
|
967 |
! |
|
968 |
||
969 |
i46:something |
|
616 | 970 |
"prototype method" |
343 | 971 |
|
972 |
i46 := something. |
|
973 |
||
974 |
"Created: 21.9.1996 / 16:06:23 / cg" |
|
975 |
! |
|
976 |
||
977 |
i47 |
|
616 | 978 |
"prototype method" |
343 | 979 |
|
980 |
^ i47 |
|
981 |
||
982 |
"Created: 21.9.1996 / 16:06:23 / cg" |
|
983 |
! |
|
984 |
||
985 |
i47:something |
|
616 | 986 |
"prototype method" |
343 | 987 |
|
988 |
i47 := something. |
|
989 |
||
990 |
"Created: 21.9.1996 / 16:06:23 / cg" |
|
991 |
! |
|
992 |
||
993 |
i48 |
|
616 | 994 |
"prototype method" |
343 | 995 |
|
996 |
^ i48 |
|
997 |
||
998 |
"Created: 21.9.1996 / 16:06:23 / cg" |
|
999 |
! |
|
1000 |
||
1001 |
i48:something |
|
616 | 1002 |
"prototype method" |
343 | 1003 |
|
1004 |
i48 := something. |
|
1005 |
||
1006 |
"Created: 21.9.1996 / 16:06:23 / cg" |
|
1007 |
! |
|
1008 |
||
1009 |
i49 |
|
616 | 1010 |
"prototype method" |
343 | 1011 |
|
1012 |
^ i49 |
|
1013 |
||
1014 |
"Created: 21.9.1996 / 16:06:23 / cg" |
|
1015 |
! |
|
1016 |
||
1017 |
i49:something |
|
616 | 1018 |
"prototype method" |
343 | 1019 |
|
1020 |
i49 := something. |
|
1021 |
||
1022 |
"Created: 21.9.1996 / 16:06:24 / cg" |
|
1023 |
! |
|
1024 |
||
282 | 1025 |
i4:something |
616 | 1026 |
"prototype method to set the 4th instance variable" |
282 | 1027 |
|
1028 |
i4 := something. |
|
1029 |
||
1030 |
"Created: 13.5.1996 / 21:19:25 / cg" |
|
1031 |
! |
|
1032 |
||
1033 |
i5 |
|
616 | 1034 |
"prototype method to return the 5th instance variable" |
282 | 1035 |
|
1036 |
^ i5 |
|
1037 |
||
1038 |
"Created: 13.5.1996 / 21:19:26 / cg" |
|
1039 |
! |
|
1040 |
||
343 | 1041 |
i50 |
616 | 1042 |
"prototype method" |
343 | 1043 |
|
1044 |
^ i50 |
|
1045 |
||
1046 |
"Created: 21.9.1996 / 16:06:24 / cg" |
|
1047 |
! |
|
1048 |
||
1049 |
i50:something |
|
616 | 1050 |
"prototype method" |
343 | 1051 |
|
1052 |
i50 := something. |
|
1053 |
||
1054 |
"Created: 21.9.1996 / 16:06:24 / cg" |
|
1055 |
! |
|
1056 |
||
282 | 1057 |
i5:something |
616 | 1058 |
"prototype method to set the 5th instance variable" |
282 | 1059 |
|
1060 |
i5 := something. |
|
1061 |
||
1062 |
"Created: 13.5.1996 / 21:19:26 / cg" |
|
1063 |
! |
|
1064 |
||
1065 |
i6 |
|
616 | 1066 |
"prototype method to return the 6th instance variable" |
282 | 1067 |
|
1068 |
^ i6 |
|
1069 |
||
1070 |
"Created: 13.5.1996 / 21:19:26 / cg" |
|
1071 |
! |
|
1072 |
||
1073 |
i6:something |
|
616 | 1074 |
"prototype method to set the 6th instance variable" |
282 | 1075 |
|
1076 |
i6 := something. |
|
1077 |
||
1078 |
"Created: 13.5.1996 / 21:19:26 / cg" |
|
1079 |
! |
|
1080 |
||
1081 |
i7 |
|
616 | 1082 |
"prototype method to return the 7th instance variable" |
282 | 1083 |
|
1084 |
^ i7 |
|
1085 |
||
1086 |
"Created: 13.5.1996 / 21:19:26 / cg" |
|
1087 |
! |
|
1088 |
||
1089 |
i7:something |
|
616 | 1090 |
"prototype method to set the 7th instance variable" |
282 | 1091 |
|
1092 |
i7 := something. |
|
1093 |
||
1094 |
"Created: 13.5.1996 / 21:19:26 / cg" |
|
1095 |
! |
|
1096 |
||
1097 |
i8 |
|
616 | 1098 |
"prototype method to return the 8th instance variable" |
282 | 1099 |
|
1100 |
^ i8 |
|
1101 |
||
1102 |
"Created: 13.5.1996 / 21:19:26 / cg" |
|
1103 |
! |
|
1104 |
||
1105 |
i8:something |
|
616 | 1106 |
"prototype method to set the 8th instance variable" |
282 | 1107 |
|
1108 |
i8 := something. |
|
1109 |
||
1110 |
"Created: 13.5.1996 / 21:19:26 / cg" |
|
1111 |
! |
|
1112 |
||
1113 |
i9 |
|
616 | 1114 |
"prototype method to return the 9th instance variable" |
282 | 1115 |
|
1116 |
^ i9 |
|
1117 |
||
1118 |
"Created: 13.5.1996 / 21:19:26 / cg" |
|
1119 |
! |
|
1120 |
||
1121 |
i9:something |
|
616 | 1122 |
"prototype method to set the 9th instance variable" |
282 | 1123 |
|
1124 |
i9 := something. |
|
1125 |
||
1126 |
"Created: 13.5.1996 / 21:19:27 / cg" |
|
1127 |
! |
|
1128 |
||
1129 |
instSize |
|
1130 |
"return instSize - required class protocol" |
|
1131 |
||
1132 |
^ instSize |
|
1133 |
||
1134 |
"Created: 13.5.1996 / 21:19:24 / cg" |
|
1135 |
! |
|
1136 |
||
1137 |
instSize:something |
|
1138 |
"set instSize - required class protocol" |
|
1139 |
||
1140 |
instSize := something. |
|
1141 |
||
1142 |
"Created: 13.5.1996 / 21:19:25 / cg" |
|
1143 |
! |
|
1144 |
||
429 | 1145 |
methodDictionary |
1146 |
"return the methodDictionary - required class protocol" |
|
282 | 1147 |
|
429 | 1148 |
^ methodDictionary |
282 | 1149 |
! |
1150 |
||
1151 |
otherSupers |
|
1152 |
"return otherSupers" |
|
1153 |
||
1154 |
^ otherSupers |
|
1155 |
||
1156 |
"Created: 13.5.1996 / 21:19:24 / cg" |
|
1157 |
! |
|
1158 |
||
1159 |
otherSupers:something |
|
1160 |
"set otherSupers" |
|
1161 |
||
1162 |
otherSupers := something. |
|
1163 |
||
1164 |
"Created: 13.5.1996 / 21:19:24 / cg" |
|
1165 |
! |
|
1166 |
||
1167 |
superclass |
|
1168 |
"return superclass - required class protocol" |
|
1169 |
||
1170 |
^ superclass |
|
1171 |
||
1172 |
"Created: 13.5.1996 / 21:19:23 / cg" |
|
1173 |
! |
|
1174 |
||
1175 |
superclass:something |
|
1176 |
"set superclass - required class protocol" |
|
1177 |
||
1178 |
superclass := something. |
|
1179 |
||
1180 |
"Created: 13.5.1996 / 21:19:23 / cg" |
|
1181 |
! ! |
|
1182 |
||
1183 |
!Structure methodsFor:'stubs'! |
|
1184 |
||
1185 |
doesNotUnderstand:aMessage |
|
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
1186 |
"catch unimplemented messages - pass some to the superclass. |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
1187 |
Notice that although this method calls super messages, |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
1188 |
actual instances will have no valid superClass." |
282 | 1189 |
|
616 | 1190 |
|sel args names sz s idx| |
282 | 1191 |
|
1192 |
"/ instance protocol |
|
1193 |
||
1194 |
sel := aMessage selector. |
|
1195 |
args := aMessage arguments. |
|
1196 |
||
1197 |
sel == #displayString ifTrue:[ |
|
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
1198 |
s := WriteStream on:''. |
282 | 1199 |
s nextPutAll:'Structure('. |
1200 |
names := self allInstVarNames. |
|
616 | 1201 |
names notNil ifTrue:[ |
1202 |
names keysAndValuesDo:[:idx :nm | |
|
1203 |
s nextPutAll:nm; nextPutAll:'->'. |
|
1204 |
s nextPutAll:(self at:idx) displayString. |
|
1205 |
s space |
|
1206 |
]. |
|
282 | 1207 |
]. |
1208 |
s nextPutAll:')'. |
|
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
1209 |
^ s contents |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
1210 |
]. |
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
1211 |
|
282 | 1212 |
sel == #basicInspect ifTrue:[ |
1213 |
^ InspectorView openOn:self |
|
1214 |
]. |
|
1215 |
||
1216 |
sel == #inspect ifTrue:[ |
|
1217 |
^ InspectorView openOn:self |
|
1218 |
]. |
|
1219 |
||
1220 |
sel == #instVarAt: ifTrue:[ |
|
1221 |
|nr| |
|
1222 |
||
1223 |
nr := args at:1. |
|
1224 |
nr == 1 ifTrue:[^ i1]. |
|
1225 |
nr == 2 ifTrue:[^ i2]. |
|
1226 |
nr == 3 ifTrue:[^ i3]. |
|
1227 |
nr == 4 ifTrue:[^ i4]. |
|
1228 |
nr == 5 ifTrue:[^ i5]. |
|
1229 |
nr == 6 ifTrue:[^ i6]. |
|
1230 |
^ nil |
|
1231 |
]. |
|
1232 |
||
1233 |
(sel == #size |
|
1234 |
or:[sel == #basicSize]) ifTrue:[ |
|
1235 |
^ super basicSize |
|
1236 |
]. |
|
1237 |
||
1238 |
(sel == #at: |
|
1239 |
or:[sel == #basicAt:]) ifTrue:[ |
|
1240 |
^ super basicAt:(args at:1) |
|
1241 |
]. |
|
1242 |
||
1243 |
(sel == #at:put: |
|
1244 |
or:[sel == #basicAt:put:]) ifTrue:[ |
|
1245 |
^ super basicAt:(args at:1) put:(args at:2) |
|
1246 |
]. |
|
1247 |
||
1248 |
sel == #== ifTrue:[ |
|
1249 |
^ self == (args at:1) |
|
1250 |
]. |
|
1251 |
||
945 | 1252 |
sel == #clone ifTrue:[ |
1253 |
^ super clone |
|
1254 |
]. |
|
1255 |
sel == #shallowCopy ifTrue:[ |
|
1256 |
^ super shallowCopy |
|
1257 |
]. |
|
1258 |
||
1259 |
||
282 | 1260 |
"/ class protocol |
1261 |
||
1262 |
(sel := aMessage selector) == #name ifTrue:[ |
|
1263 |
^ 'Structure' |
|
1264 |
]. |
|
1265 |
||
1266 |
sel == #isVariable ifTrue:[ |
|
1267 |
^ false |
|
1268 |
]. |
|
1269 |
||
1270 |
sel == #isClass ifTrue:[ |
|
1271 |
^ false |
|
1272 |
]. |
|
1273 |
||
1274 |
sel == #isMeta ifTrue:[ |
|
1275 |
^ false |
|
1276 |
]. |
|
1277 |
||
1278 |
sel == #isBehavior ifTrue:[ |
|
1279 |
^ false |
|
1280 |
]. |
|
1281 |
||
1282 |
sel == #respondsTo: ifTrue:[ |
|
1283 |
^ false |
|
1284 |
]. |
|
1285 |
||
616 | 1286 |
sel == #whichClassIncludesSelector: ifTrue:[ |
1287 |
^ nil |
|
1288 |
]. |
|
1289 |
||
282 | 1290 |
sel == #evaluatorClass ifTrue:[ |
1291 |
^ Compiler |
|
1292 |
]. |
|
1293 |
||
1294 |
sel == #classNameWithArticle ifTrue:[ |
|
1295 |
^ self displayString |
|
1296 |
]. |
|
1297 |
||
1298 |
sel == #allSubclasses ifTrue:[ |
|
1299 |
^ #() |
|
1300 |
]. |
|
1301 |
||
1302 |
sel == #allClassVarNames ifTrue:[ |
|
1303 |
^ #() |
|
1304 |
]. |
|
1305 |
||
1306 |
sel == #allInstVarNames ifTrue:[ |
|
616 | 1307 |
methodDictionary isNil ifTrue:[ |
1308 |
'oops - nil ethodDict' printCR. |
|
1309 |
^ #() |
|
1310 |
]. |
|
1311 |
||
282 | 1312 |
sz := super basicSize. |
1313 |
names := Array new:sz. |
|
1314 |
||
616 | 1315 |
methodDictionary keysAndValuesDo:[:sel :mthd| |
1316 |
|index mysel| |
|
1317 |
||
282 | 1318 |
(sel endsWith:$:) ifFalse:[ |
1319 |
(sel ~~ #class) ifTrue:[ |
|
1320 |
"/ |
|
1321 |
"/ which method is it ? |
|
1322 |
"/ |
|
616 | 1323 |
idx := 1. |
1324 |
[idx <= sz] whileTrue:[ |
|
1325 |
mysel := ('i' , idx printString) asSymbol. |
|
282 | 1326 |
mthd == (Structure compiledMethodAt:mysel) ifTrue:[ |
616 | 1327 |
names at:idx put:sel. |
1328 |
idx := sz. "/ break |
|
1329 |
]. |
|
1330 |
idx := idx + 1. |
|
282 | 1331 |
]. |
1332 |
] |
|
1333 |
] |
|
1334 |
]. |
|
1335 |
||
1336 |
^ names |
|
1337 |
]. |
|
1338 |
||
943
5a9699ed4b9b
give the dummy class another name, to avoid confusion with
Claus Gittinger <cg@exept.de>
parents:
654
diff
changeset
|
1339 |
(sel == #instSize) ifTrue:[ |
5a9699ed4b9b
give the dummy class another name, to avoid confusion with
Claus Gittinger <cg@exept.de>
parents:
654
diff
changeset
|
1340 |
^ instSize |
5a9699ed4b9b
give the dummy class another name, to avoid confusion with
Claus Gittinger <cg@exept.de>
parents:
654
diff
changeset
|
1341 |
]. |
5a9699ed4b9b
give the dummy class another name, to avoid confusion with
Claus Gittinger <cg@exept.de>
parents:
654
diff
changeset
|
1342 |
|
616 | 1343 |
'Structure [warning]: return nil for: ' print. |
1344 |
aMessage print. |
|
1345 |
' args ' print. args printCR. |
|
282 | 1346 |
|
294
6f937c0ba907
fixes for new MethodDictionary
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
1347 |
^ nil. |
282 | 1348 |
|
1349 |
"Created: 13.5.1996 / 20:22:22 / cg" |
|
1350 |
"Modified: 13.5.1996 / 21:12:54 / cg" |
|
1351 |
! ! |
|
1352 |
||
616 | 1353 |
!Structure class methodsFor:'documentation'! |
282 | 1354 |
|
1355 |
version |
|
953 | 1356 |
^ '$Header: /cvs/stx/stx/libcomp/Structure.st,v 1.10 1999-09-03 15:36:50 cg Exp $' |
282 | 1357 |
! ! |
1358 |
Structure initialize! |