equal
deleted
inserted
replaced
188 ] |
188 ] |
189 " |
189 " |
190 ! |
190 ! |
191 |
191 |
192 newWithSize:size |
192 newWithSize:size |
193 "return a new collection of size. |
|
194 For variable size collections, this is different from #new:, |
|
195 in that #new: creates an empty collection with preallocated size, |
|
196 while #withSize: creates a non empty one." |
|
197 |
|
198 ^ (self new:size) grow:size. |
|
199 |
|
200 " |
|
201 (OrderedCollection new:10) inspect. |
|
202 (OrderedCollection withSize:10) inspect. |
|
203 (Array new:10) inspect. |
|
204 (Array withSize:10) inspect. |
|
205 " |
|
206 ! |
|
207 |
|
208 withSize:size |
|
209 "return a new collection of size. |
193 "return a new collection of size. |
210 For variable size collections, this is different from #new:, |
194 For variable size collections, this is different from #new:, |
211 in that #new: creates an empty collection with preallocated size, |
195 in that #new: creates an empty collection with preallocated size, |
212 while #withSize: creates a non empty one." |
196 while #withSize: creates a non empty one." |
213 |
197 |