[racket-dev] Potential search improvement

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Tue May 29 10:31:35 EDT 2012

On Tue, May 29, 2012 at 10:25 AM, Eli Barzilay <eli at barzilay.org> wrote:
> 20 minutes ago, Eli Barzilay wrote:
>> An hour and a half ago, Sam Tobin-Hochstadt wrote:
>> >
>> > To stop the sort in the middle, use a custom comparison function,
>> > a bit of state, and an exception.
>> This might work.
> I was confused.  It does work, but it's not enough to be able to throw
> an exception -- I also need some form of a yield() call to check if it
> should be interrupted...  Is there something like that?

No, not cross-browser.  You'll need to manually do the CPS and defer
the continuation to the next turn in the event loop.  Writing a merge
sort in this style might work.

`yield` is coming in the next version of JS, and is already in
Firefox, but that doesn't help now.
sam th
samth at ccs.neu.edu

Posted on the dev mailing list.