[racket] help on understanding abort-current-continuation at the toplevel module level

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Fri Mar 16 16:44:26 EDT 2012

FWIW, DrRacket's module language apparently gets this one wrong
somehow (at least it disagrees with running 'racket' in the shell).

Robby

On Fri, Mar 16, 2012 at 3:31 PM, Danny Yoo <dyoo at cs.wpi.edu> wrote:
> I'm trying to find information on what the default handler is, for the
> prompts established at the toplevel of a module.  From the following
> program:
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> #lang racket/base
>
> 1
> (call-with-continuation-prompt
>  (lambda ()
>   (abort-current-continuation (default-continuation-prompt-tag)
>                               (lambda () (printf "hello\n")))))
>
> 2
>
> (abort-current-continuation (default-continuation-prompt-tag)
>                            (lambda () (printf "world\n")))
>
> 3
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
> I was expecting each statement to be wrapped in a prompt whose handler
> re-establishes the prompt and calls the thunk, that is, I was
> expecting the implicit handler:
>
>    (lambda (abort-thunk)
>       (call-with-continuation-prompt abort-thunk prompt-tag #f))
>
> wrapped around each toplevel module expression, and that I'd see
> "1hello\n2world\n3".  But as usual, I'm wrong.  :)
>
> Where in the documentation can I find the behavior of the prompt
> handler that's wrapped around each module toplevel expression?
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users


Posted on the users mailing list.