On Tuesday 06 January 2009, Jonathan Shapiro wrote:
> On Mon, Jan 5, 2009 at 4:51 PM, Marvin Sielenkemper <[email protected]> wrote:
> > 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))))
>
> Since we can re-throw without allocating storage, and our exception system
> does not admit inheritance, there isn't really any advantage to the C++
> syntax, and it's just one more bit of exceptional-case and
> context-dependent syntax to support. The only reason that C++ needs this is
> that the (catch ...) syntax doesn't provide any identifier that can be
> passed to throw.
>
> Just one of many ways in which C++ exceptions leave something to be
> desired.
>
> I don't see any win in this. Do you see something here that I may be
> failing to consider?

Not really. I just think it would be nice to make it clear that error handling 
is resumed at that point. But I agree that adding this would add a lot of 
unnecessary complexity to the compiler.

> In any case, the support for your case, and also for re-throwing exceptions
> that are already discriminated, is now in the tree. You can grab it
> instantly with "hg pull;hg update", or you should be able to sync it from
> the public tree in a few minutes.

Just installed Mercurial and now trying to get a repository ...

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

Reply via email to