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