[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Scheme-reports] 4.2.7. Exception Handling
- To: Andy Wingo <wingo@x>
- Subject: Re: [Scheme-reports] 4.2.7. Exception Handling
- From: John Cowan <cowan@x>
- Date: Wed, 18 May 2011 15:03:00 -0400
- Cc: scheme-reports@x
- In-reply-to: <firstname.lastname@example.org>
- References: <email@example.com> <4DD39D16.firstname.lastname@example.org> <email@example.com>
Andy Wingo scripsit:
> Are you sure? :-) The spec notes:
> "That implicit `cond' expression is evaluated with the continuation
> and dynamic extent of the `guard' expression"
> "The final expression in a <cond> clause is in a tail context if the
> `guard' expression itself is."
The idea is that "guard" installs a handler which first unwinds and then
evaluates the cond, rewinding if it doesn't find an appropriate clause.
This provides termination semantics in the style of C++, Java, C#, etc.
but with the possibility of carrying on if the guard gets something it
doesn't expect. If you want instead to get control in the scope of the
raiser, don't use "guard" but rather "with-exception-handler" to install
your own handler.
It was impossible to inveigle John Cowan <cowan@x>
Georg Wilhelm Friedrich Hegel http://www.ccil.org/~cowan
Into offering the slightest apology
For his Phenomenology. --W. H. Auden, from "People" (1953)
Scheme-reports mailing list