Hi Ricky,
What an idiot I am! :-)
Indeed, it is returning a sorted copy! Now, it's working!
Thanks a lot!
Romain
-----Message d'origine-----
De : Richard Wettel [mailto:richard.wettel@lu.unisi.ch]
Envoyé : mercredi 16 avril 2008 12:57
À : peirsro(a)ensieta.fr; Related to the development of Moose and other
related tools
Objet : Re: [Moose-dev] Re: Does the message sorted: in the method
MooseModel>>packagesDSM do anything?
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(a)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(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev