Program logic bugs vs input/environmental errors

Sean Kelly via Digitalmars-d digitalmars-d at puremagic.com
Thu Oct 16 06:46:34 PDT 2014


On Thursday, 16 October 2014 at 07:44:37 UTC, Walter Bright wrote:
> On 10/15/2014 6:54 PM, Sean Kelly wrote:
>> I hate to say it, but I'm inclined to treat nothrow the same 
>> as in C++, which is
>> to basically pretend it's not a part of the language. The 
>> efficiency is nice,
>> but not if it means that throwing an Error will cause the 
>> program to be
>> invalid.  Please tell me there's no plan to change the 
>> unwinding behavior when
>> Error is thrown in standard (ie not nothrow) code.
>
> Don't throw Errors when you need to unwind. Throw Exceptions. 
> I.e. use enforce() instead of assert().

I'm more concerned about Phobos. If it uses nothrow and asserts 
in preconditions then the decision has been made for me.


More information about the Digitalmars-d mailing list