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: Rick Flower
Subject: Re: [Help-smalltalk] What is wrong with my sort: block?
Date: Tue, 11 Dec 2012 07:11:15 -0800
User-agent: Apple Webmail/0.6

On 11.12.2012 00:12, Ladislav Marek wrote:

You are using non-local return in block, thats not correct (in this
case). ^false will return from your method and sort: will not be
completed. Last expression is the result in block, so correct code is:

myCollection sort: [ :a :b | a value not ].
myCollection inspect.

BINGO!  Worked like a charm.. So, what you're saying is that the
forced ^false will essentially abort the sort operation completely
leaving it unchanged?  Ok.. Did some googling around for the
phrase "non-local return smalltalk" and found a good definition
on the objectmix.com website.. I'd never heard of this before but it
certainly explains the behavior I was seeing.. Thanks for the heads-up!





reply via email to

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