[Newbies] Re: How to sort a SortedCollection like you can sort a
table in Excel?
keith
keith_hodges at yahoo.co.uk
Mon Apr 12 20:53:11 UTC 2010
I add a <= to
then you can write:
[ :a :b | { a width. a depth. } <= { b width. b depth } ]
regards
Keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0009-SequencableCollectionLessThan.1.st
Type: application/octet-stream
Size: 1437 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/beginners/attachments/20100412/9779e29e/0009-SequencableCollectionLessThan.1-0001.obj
-------------- next part --------------
On 12 Apr 2010, at 17:52, Andreas Raab wrote:
> On 4/12/2010 7:48 AM, Bert Freudenberg wrote:
>> Hmm, indenting it like this makes it more obvious:
>>
>> a height> b height or: [
>> a height = b height and: [
>> a width> b width or: [
>> a width = b width and: [
>> a depth> b depth]]]]
>
> Personally, I write multi-level sort blocks like here:
>
> a height = b height
> ifTrue:[a width = b width
> ifTrue:[a depth >= b depth]]
> ifFalse:[a width >= b width]
> ifFalse:[a height >= b height]
>
> Cheers,
> - Andreas
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
More information about the Beginners
mailing list