On Monday 05 January 2009, Jonathan S. Shapiro wrote:
> Marvin Sielenkemper sent me a bug report in private mail. The bug and its
> immediate solution are obvious, but Swaroop and I noticed a larger issue in
> discussion, and I want to discuss it.
>
> Marvin's original bug reported that:
>
>   (try e1 (catch excpt-id (otherwise e2 (throw excpt-id))))
>
> failed with a syntax error.
[...]
>
> For the moment, we're going to hack THROW to accept exception leg types,
> and leave the rest as a problem/opportunity for the future.

I have been thinking about another possible hack for THROW:
In C++ there is a special form of "throw" without parameters. This form may 
only be used in a "catch" clause and just rethrows the currently handled 
exception (it basically resumes the stack unwinding).
This avoids the neccessity to copy the exception and is the only thing 
possible if the exception was caught via a reference to a base class or the 
C++ variant of "otherwise", the "catch (...)".
In that case I wouldn't even need the fix for the missing binding:
  (try e1 (catch _ (otherwise e2 (throw))))

-- 
MfG Marvin H. Sielenkemper
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to