Alternatives to exceptions for error handling

IGotD- nise at nise.com
Tue Nov 24 22:25:23 UTC 2020


On Tuesday, 24 November 2020 at 22:14:03 UTC, H. S. Teoh wrote:
>
> I've said before, and I'll say again: I suspect that most 
> (all?) of the current objections against exceptions comes from 
> the current *implementation* of it, i.e., libunwind, et al..  
> There are other ways to implement the concept of exceptions 
> that can potentially avoid these issues.
>

There is one thing that I think must go in D and that is chaining 
exception, catching several exceptions. As it is today this 
requires memory allocation itself and I'm not sure that we can 
support exception chains without memory allocation.

My experience is that looping through exceptions is extremely 
unusual and normally it is a first served approach that is used. 
Double, triple or more faults is often too difficult to deal with.


More information about the Digitalmars-d mailing list