DIP33: A standard exception hierarchy

Lars T. Kyllingstad public at kyllingen.net
Wed Apr 3 02:44:22 PDT 2013


On Wednesday, 3 April 2013 at 08:40:52 UTC, deadalnix wrote:
> On Tuesday, 2 April 2013 at 20:11:31 UTC, Lars T. Kyllingstad 
> wrote:
>> Phobos/druntime devs can always add to the enums.  Users still 
>> have the option of subclassing if strictly necessary.
>>
>
> This is fundamentally incompatible with :
>
>> I'm not sure I agree with that rule.  And anyway, D's final 
>> switch mitigate some of the problems with classic switch.
>>
>
> As adding an entry unto the enum will break every single final 
> switch in user code.

I don't see the incompatibility.  This is exactly the purpose of 
final switch.  If the user didn't want to be forced to handle a 
new error category, they'd use normal switch instead.

You have yet to specify the problems with switch in OOP.  Maybe 
you meant something else, that final switch doesn't solve?

Lars


More information about the Digitalmars-d mailing list