std.sumtype?

ryuukk_ ryuukk_ at gmail.com
Thu Mar 18 18:29:34 UTC 2021


On Thursday, 18 March 2021 at 18:15:29 UTC, Paul Backus wrote:
> On Thursday, 18 March 2021 at 18:06:45 UTC, ryuukk_ wrote:
>> I'm not a fan of the syntax.. why is it a library instead of a 
>> language feature?..
>
> Because it's easier to write a library than to go through the 
> whole process of writing a DIP for a new language feature, 
> getting it accepted, and implementing it in the compiler.
>
> If you or anyone else wants to write a DIP to add sum types to 
> D as a language feature, I will happily support the effort, but 
> I am not going to do it myself.
>
>> Because now you depend on ``std``
>
> `std.sumtype` has no non-optional dependencies on Phobos 
> outside of compile time, so you can use it even if you do not 
> want to depend on anything else in `std`.


That's how i feel about it, people didn't care enough and easiest 
solution picked (let's put this lib instead), now you have to use 
a feature, as a lib, calling functions that looks like template 
functions, in the end it is confusing

i can switch(t), but i can't match(t), i need to use a different 
syntax


More information about the Digitalmars-d mailing list