Worst ideas/features in programming languages?
Paul Backus
snarwin at gmail.com
Tue Oct 12 16:26:33 UTC 2021
On Tuesday, 12 October 2021 at 16:19:42 UTC, Nick Treleaven wrote:
> On Monday, 11 October 2021 at 21:21:21 UTC, Paul Backus wrote:
>> The real missing piece here IMO is DIP 1038 [1]. Once it is
>> fully accepted and implemented, defining a Result type will be
>> trivial.
>
> Could you explain how @nodiscard would help with sum types?
> Presumably it won't help to implicitly convert a subtype into
> the wrapper sum type?
Currently, the big advantage exceptions have over sum types is
that you cannot accidentally ignore an exception. Either you
catch it, or it crashes your program.
With `@nodiscard`, we can eliminate this advantage, and put sum
types and exceptions on an equal playing field.
More information about the Digitalmars-d
mailing list