Exception/Error division in D

Tobias Pankrath tobias at pankrath.net
Fri Jun 1 05:16:48 PDT 2012


On Friday, 1 June 2012 at 12:03:15 UTC, deadalnix wrote:
> Le 01/06/2012 12:29, Walter Bright a écrit :
>> On 6/1/2012 1:15 AM, Jens Mueller wrote:
>>> Since the current implementation does not follow the 
>>> specification
>>> regarding scope and finally block being executed in case of 
>>> Error will
>>> try ... catch (...Error) keep working?
>>
>> No. The reason for this is the implementation was not updated 
>> after the
>> split between Error and Exception happened. It was overlooked.
>>
>>> I have code that uses
>>> assertThrows!AssertError to test some in contracts. Will this 
>>> code
>>> break?
>>
>> I don't know exactly what your code is, but if you're relying 
>> on scope
>> to unwind in the presence of Errors, that will break.
>>
>
> If you have an error, it is already broken in some way.
>
> But this is unreasonable to think that the whole program is 
> broken, except in very specific cases (stack corruption for 
> instance) but in such a case, you can't throw an error anyway.

I agree. It should be possible to have an plugin system where not 
every null pointer dereference in a plugin screws up the hole 
program. Without using different processes for the plugin.

90% of null pointer dereferences are simple bugs not memory 
corruption.



More information about the Digitalmars-d mailing list