[racket] raise-ing an exception inside prompt
I'm not sure if I got your point, as I seem to have the same result
after replacing with displayln.
My concern is why I get a type error only for the latter?
(And how I could get both the exception and type error?)
Keiko
From: Matthias Felleisen <matthias at ccs.neu.edu>
Subject: Re: [racket] raise-ing an exception inside prompt
Date: Wed, 22 Dec 2010 12:15:21 -0500
>
> 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
>
>