DIP65: Fixing Exception Handling Syntax

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 17 14:03:06 PDT 2014


On 7/17/2014 1:44 PM, Justin Whear wrote:
> On Thu, 17 Jul 2014 12:28:33 -0700, Andrei Alexandrescu wrote:
>
>> On 7/8/14, 2:31 PM, Brian Schott wrote:
>>> http://wiki.dlang.org/DIP65
>>>
>>> tldr: There are parser and specification bugs and I want to fix them.
>>> It will break some poorly-written code, but I think I can automate the
>>> upgrade process.
>>
>> I vote we reject this DIP. It has clear appeal but there's also the
>> issue with putting currently correct code on a deprecation path, with no
>> obvious win in quality.
>>
>> I think Walter's fix eliminates the problem during the semantic pass
>> even though there's a grammar ambiguity. It's a judgment call, and by
>> definition someone has to make it.
>>
>>
>> Andrei
>
> My understanding (and this is supported by hard numbers from Brian's
> survey of Phobos), is that Walter's proposal will perpetuate a bad design
> choice that is rarely if ever used (never in Phobos) in favor of
> deprecating a better syntax that is used (in Phobos and elsewhere).
>
> That is to say, we have hard numbers to prove that Walter's fix will
> deprecate currently working code while leaving us with the less-desirable
> syntax, while Brian's proposal will transition us to the more desirable
> syntax without breaking code written in the currently used idiom.
>
> And, as Brian pointed out[1], the current idiom of `catch (Throwable)`
> _is described_ in the spec, albeit not in the formal grammar.  Ergo,
> Walter's fix also deprecates currently-working, correct syntax.  Given
> that both are correct, but one is nearly completely unused and error
> prone, I vote yes on this DIP.
>
> [1] http://forum.dlang.org/thread/xmqzrgysgxdmqrnfpxdq@forum.dlang.org?
> page=2#post-zsvbxhtbwevsrrflxzyr:40forum.dlang.org
>

Did you see my response?

I suggested 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.



More information about the Digitalmars-d mailing list