[racket] raise vs abort

From: Keiko Nakata (keiko at kurims.kyoto-u.ac.jp)
Date: Thu Jan 6 11:08:22 EST 2011

On Thu, Jan 6, 2011 at 3:20 PM, Casey Klein <clklein at eecs.northwestern.edu> wrote:
> > Still I am not certain that this behavior of 'raise' cannot be implemented
> > by other (delimited) control operators. And, probably I do not still
> > understand why 'raise' has to be a primitive.
> 
> It can be implemented in terms of continuation marks (if you know the
> key for exception handlers).

You are probably saying 'raise' is different from 'abort' as 'raise' installs a barrier,
which renders it to be a primitive. 
This should answer my question, I think. 

> > Something along this:
> >
> > (with-handlers ([(lambda (_) true) (lambda (x) ((car x) (cdr x)))])
> >  (prompt (+ (control f (raise (cons f 3))) 1)))
> >
> > will not work?
> >
> 
> Now I'm not sure I understand what you're trying to do. I thought the
> goal was to simulate `raise' using `abort', but this program uses
> `raise' directly.

I was trying to mimic the behavior of 'call-with-exception-handler'
via 'with-handler'. But please ignore this.

Thanks, 
Keiko


Posted on the users mailing list.