[Newbies] Re: indexing into a collection

2016-07-26 Thread Joseph Alotta
Ben, Ron, I made a small example, and it works as you said it would: a := #( #(1 2) #(3 4)). b := a asOrderedCollection. b => an OrderedCollection(#(1 2) #(3 4)) c := b select: [ :i | (i first) = 3 ]. c => an OrderedCollection(#(3 4)) d := c first d => #(3 4) d at: 2 put: 5 d => #(3 5) b =>

Re: [Newbies] indexing into a collection

2016-07-26 Thread Ben Coman
Hi Joe, As Ron said, you should not be getting a copy. If you still have a problem, perhaps best if you post code for a complete example: * class definition (with just two instance variables) * instance variable accessor methods * instance creation & adding to collection * select statement *

RE: [Newbies] indexing into a collection

2016-07-26 Thread Ron Teitelbaum
Hi Joe, If the orderedCollection contains your object DrivingDays then select should give you the object and not a copy. You don't need to add it back to the collection just update the object. Check your code for anything that might be making a copy. All the best, Ron Teitelbaum

[Newbies] indexing into a collection

2016-07-26 Thread Joseph Alotta
Greetings, I have a OrderedCollection of DrivingDays. an OrderedCollection(2016-01-02| quigley s| nil|18§ 2016-01-03| marianos fresh| nil|5§ 2016-01-04| fresh thyme| nil|5§ 2016-01-05| panda express| nil|3§