On Tue, May 29, 2012 at 10:25 AM, Eli Barzilay <e...@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 sa...@ccs.neu.edu _________________________ Racket Developers list: http://lists.racket-lang.org/dev