Hi Ricky,
Thanks for your answer. But my problem is that my collection is not sorted after this kind of message: aCollection sorted: [:e1 :e2 | e1 staticNeededPackages size < e2 staticNeededPackages size] I don't really understand why!
Cheers
Romain
-----Message d'origine----- De : Richard Wettel [mailto:richard.wettel@lu.unisi.ch] Envoyé : mercredi 16 avril 2008 12:15 À : peirsro@ensieta.fr; Related to the development of Moose and other related tools Objet : Re: [Moose-dev] Does the message sorted: in the method MooseModel>>packagesDSM do anything?
Hi Romain,
#sorted: expects a block with 2 arguments, such as: aCollection sorted: [:e1 :e2 | e1 staticNeededPackages size < e2 staticNeededPackages size] which will sort the elements ascending. For more examples, just search for the senders of the selector #sorted:
Cheers, Ricky
On Apr 16, 2008, at 11:55 AM, Romain PEIRS wrote:
Hi everybody !
Im working on the method MooseModel >> packagesDSM and I noticed that the message sorted: sent to an OrderedCollection doesnt sort anything! I also tried with a simple condition of sort: p1staticNeededPackages size
p2staticNeededPackages size
I dont understand why the OrderedCollection is not sorted. Have I forgot anything?
Thanks
Romain
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Hi Romain,
I got your question wrong. That's why the #sorted: in SequenceableCollection is returning a sorted copy of your collection, and does not modify the original collection.
Ricky
On Apr 16, 2008, at 12:43 PM, Romain PEIRS wrote:
Hi Ricky,
Thanks for your answer. But my problem is that my collection is not sorted after this kind of message: aCollection sorted: [:e1 :e2 | e1 staticNeededPackages size < e2 staticNeededPackages size] I don't really understand why!
Cheers
Romain
-----Message d'origine----- De : Richard Wettel [mailto:richard.wettel@lu.unisi.ch] Envoyé : mercredi 16 avril 2008 12:15 À : peirsro@ensieta.fr; Related to the development of Moose and other related tools Objet : Re: [Moose-dev] Does the message sorted: in the method MooseModel>>packagesDSM do anything?
Hi Romain,
#sorted: expects a block with 2 arguments, such as: aCollection sorted: [:e1 :e2 | e1 staticNeededPackages size < e2 staticNeededPackages size] which will sort the elements ascending. For more examples, just search for the senders of the selector #sorted:
Cheers, Ricky
On Apr 16, 2008, at 11:55 AM, Romain PEIRS wrote:
Hi everybody !
I’m working on the method MooseModel >> packagesDSM and I noticed that the message sorted: sent to an OrderedCollection doesn’t sort anything! I also tried with a simple condition of sort: p1staticNeededPackages size
p2staticNeededPackages size
I don’t understand why the OrderedCollection is not sorted. Have I forgot anything?
Thanks
Romain
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev