equal
deleted
inserted
replaced
137 sz := self size. |
137 sz := self size. |
138 ^ (Array new:sz) |
138 ^ (Array new:sz) |
139 replaceFrom:1 to:sz with:self startingAt:1 |
139 replaceFrom:1 to:sz with:self startingAt:1 |
140 ! ! |
140 ! ! |
141 |
141 |
142 !ImmutableArray methodsFor:'error handling'! |
|
143 |
|
144 creator |
|
145 "find the method that contains me" |
|
146 |
|
147 ^ Method allSubInstances detect:[:aMethod | (aMethod referencesGlobal:self)] ifNone:nil. |
|
148 |
|
149 " |
|
150 #(1 2 3) creator |
|
151 " |
|
152 |
|
153 "Modified: 24.6.1996 / 15:36:28 / stefan" |
|
154 ! |
|
155 |
|
156 noModificationError |
|
157 "a store is attempted - for our convenience, find the method that |
|
158 contains me, for a nicer error message" |
|
159 |
|
160 |creator msg context| |
|
161 |
|
162 creator := self creator. |
|
163 creator notNil ifTrue:[ |
|
164 msg := ' (' , creator whoString , ')' |
|
165 ]. |
|
166 context := thisContext sender. |
|
167 " |
|
168 this error is reported on an attempt to store into a literal |
|
169 array. The literal was created in creator. |
|
170 If you press continue in the debugger, the store will be performed. |
|
171 If you don't want this, press abort and check your code. |
|
172 Storing into literals is VERY VERY bad coding style. |
|
173 " |
|
174 NoModificationError |
|
175 raiseRequestWith:self |
|
176 errorString:msg |
|
177 in:context. |
|
178 |
|
179 "Created: / 3.8.1998 / 14:47:45 / cg" |
|
180 ! ! |
|
181 |
|
182 !ImmutableArray methodsFor:'private'! |
142 !ImmutableArray methodsFor:'private'! |
183 |
143 |
184 species |
144 species |
185 "Copies should be mutable" |
145 "Copies should be mutable" |
186 |
146 |
217 ! ! |
177 ! ! |
218 |
178 |
219 !ImmutableArray class methodsFor:'documentation'! |
179 !ImmutableArray class methodsFor:'documentation'! |
220 |
180 |
221 version |
181 version |
222 ^ '$Header: /cvs/stx/stx/libbasic/ImmutableArray.st,v 1.28 2009-11-16 08:59:40 stefan Exp $' |
182 ^ '$Header: /cvs/stx/stx/libbasic/ImmutableArray.st,v 1.29 2012-02-27 19:44:21 cg Exp $' |
223 ! |
183 ! |
224 |
184 |
225 version_CVS |
185 version_CVS |
226 ^ '$Header: /cvs/stx/stx/libbasic/ImmutableArray.st,v 1.28 2009-11-16 08:59:40 stefan Exp $' |
186 ^ '$Header: /cvs/stx/stx/libbasic/ImmutableArray.st,v 1.29 2012-02-27 19:44:21 cg Exp $' |
227 ! ! |
187 ! ! |