help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] What is wrong with my sort: block?


From: Holger Hans Peter Freyther
Subject: Re: [Help-smalltalk] What is wrong with my sort: block?
Date: Tue, 11 Dec 2012 09:45:46 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Dec 10, 2012 at 06:28:58PM -0800, Rick Flower wrote:
Hi,


> But when I execute something like that shown
> below it always returns the same thing -- namely
> no change..  I even tried hard-coding ^false when
> it was only 2 entries and it made no difference..
> Any ideas?
> 
> myCollection sort: [:a :b |
>    a value ifTrue: [^false ].
>    ^true.
> ].
> myCollection inspect

two guesses
a.) A copy is returned by your invocation of sort.
b.) You should really compare a to b? Return only
true if a is true and b is false?

holger




reply via email to

[Prev in Thread] Current Thread [Next in Thread]