[racket] Handling errors from in-directory - and handling errors more generally

From: Eli Barzilay (eli at barzilay.org)
Date: Wed Oct 13 20:48:05 EDT 2010

Yesterday, Matthew Flatt wrote:
> 
> Code that raises an exception can include a continuation in the
> exception to allow a restart, and the exception raised for an
> asynchronous break (which is usually triggered when you hit Ctl-C)
> does that. [...]

Is it supposed to be a full continuation?  I'm getting an escape one:

  -> (let ([cont? #t])
       (with-handlers ([exn:break?
                        (lambda (e)
                          (when cont?
                            (printf "BREAK! --> jump back to ~s\n"
                                    (exn:break-continuation e))
                            (set! cont? #f)
                            ((exn:break-continuation e))))])
         (for ([i (in-naturals)]) (displayln i) (sleep 0.5))))
  0
  1
  BREAK! --> jump back to #<escape-continuation>
  continuation application: attempt to jump into an escape continuation

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the users mailing list.