Alternate declaration syntax

Scott S. McCoy tag at cpan.org
Fri Apr 11 21:38:15 PDT 2008


On Fri, 2008-04-11 at 22:26 +0400, Koroskin Denis wrote:
> 
> Other than this, I like Jave-style throwable list. I believe it makes
> DBC  
> more powerful.

I agree.  "throws" lists are nice.  I've played with the idea of
suggesting this in the news group, after having discussed it on IRC, and
have figured it's a hot enough ticket item (with, honestly, maybe not
the most obvious ROI) that I might just leave well enough alone.

But since it's been brought up, I might like to add that while I *do*
like the ability to explicitly list exception types, and have the
compiler enforce atleast *something* is done about it, I dislike the
idea of the magical point in the inheritance tree where an exception
becomes "checked" (in java's definition), and would never suggest that
to another language.  Having to wrap what should probably be a simply
unhandled exception into a runtime exception so one can avoid handling,
it, is just plain silly.

So the suggestion I would make, if I were inclined to do so, would be
that exceptions become checked when and only when they are explicitly
listed in a throws clause.  However; I'll omit from actually making this
suggestion, because of the fact that D has multiple error handling paths
(scope, for instance) and that trying to leverage compile-time checking
into these multiple paths is more complex than I'd like to get into for
what we get out of it.

Cheers,
    Scott S. McCoy




More information about the Digitalmars-d mailing list