[racket] raise-ing an exception inside prompt

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Wed Dec 22 12:15:21 EST 2010

Replace print with displayln. (You're buffering the output but it isn't displayed until the repl prints the next prompt.) 


On Dec 22, 2010, at 11:56 AM, Keiko Nakata wrote:

> Hello,
> 
> How should I understand this behavior?
> 
> (with-handlers ([(lambda (_) #t) (lambda (_) (print "exit"))])
>  (print (+ (prompt (print "hi") (raise 3) (print "bye")) 10)))
> 
> prints "hi" then "exit", whereas
> 
> (+ (prompt (print "hi") (raise 3) (print "bye")) 10)
> 
> prints "hi", then I got an uncaught exception, followed by type error
> of adding <void> and 10.
> 
> Btw, where can I find the source code around exceptions, 
> e.g., raise and with-handlers?
> 
> Thanks,
> Keiko
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users



Posted on the users mailing list.