SequenceableCollection.st
branchjv
changeset 21042 edb2e7f82c62
parent 21026 81e280fc1b93
parent 21039 49823ec25298
child 21292 21faad473411
equal deleted inserted replaced
21027:ad86468de3a0 21042:edb2e7f82c62
   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