Discussion Thread: DIP 1038-- at nodiscard--Community Review Round 1

Paul Backus snarwin at gmail.com
Fri Dec 11 20:29:20 UTC 2020


On Friday, 11 December 2020 at 19:54:58 UTC, Jacob Carlborg wrote:
> On 2020-12-11 09:03, Guillaume Piolat wrote:
>> I'd be more excited about:
>> - throw-by-value exceptions
>> - a way to use exceptions in @nogc and even -betterC (There 
>> was a DIP for it, it was implemented, but doesn't work IIRC)
>> than improving error codes.
>
> I completely agree. Instead of this approach, the compiler 
> could lower try/catch/finally/throw for a function to return 
> tagged union of the success value and all the exceptions that 
> can be thrown. Then one could easily throw any kind of types, 
> not just classes inheriting from `Throwable`, including value 
> types.

Feel free to submit a DIP. :)

My experience in the D community so far has been that large, 
ambitious projects tend to fail, but small, incremental 
improvements often succeed. If someone steps forward with a DIP 
and an implementation for throw-by-value exceptions (or some 
other improved error-handling mechanism), I'll be happy to 
support them, but I'm not going to be that person myself.


More information about the Digitalmars-d mailing list