DIP65: Fixing Exception Handling Syntax

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 10 00:50:46 PDT 2014


Walter Bright:

> I suggest recognizing in the parser:
>
>    ( Identifier )
>
> as a special case, in addition to using 
> Parser::isDeclaration(). Gradually we can turn that special 
> case into a warning, then deprecation.

It's better to do the opposite, accept the common safe syntax 
"catch(Exception)" (it's common because often you don't need to 
give it a name, it's like function arguments without a variable 
name), and refuse the "catch all" that is dangerous, that is a 
bad practice even in Python.

Bye,
bearophile


More information about the Digitalmars-d mailing list