Possibility of adopting Rust's Error Handling?

mee6 mee6 at lookat.me
Sat Apr 2 12:21:23 UTC 2022


On Saturday, 2 April 2022 at 02:29:16 UTC, mesni wrote:
> On Thursday, 31 March 2022 at 21:21:04 UTC, mee6 wrote:
>> Rust's error handling is pretty good, I think they've proved 
>> the use of Result!(T, E). I was just always getting 
>> informative messages from the get go. I think there's a @nogc 
>> exception DIP in the works but I think this way of handling 
>> errors is better.
>>
>> [...]
>
> With an already existing Nullable it looks like this:
>
> ```d
> auto value = chain().get.funcs().get;
> ```
> I don't see much difference

You don't get the error of why it is null to begin with, and it 
doesn't forward errors. It is quite different even if the syntax 
is similar.



More information about the Digitalmars-d mailing list