September 11

On Tuesday, 10 September 2024 at 19:11:27 UTC, Walter Bright wrote:

>

Great! Seems like it has improved substantially since I wrote the proposal a couple years ago.

What are its shortcomings presently?

You're more than smart enough to figure it out yourself, just read the docs. std.sumtype is well documented.

September 11

On Wednesday, 11 September 2024 at 11:47:47 UTC, Dukc wrote:

>

On Tuesday, 10 September 2024 at 19:11:27 UTC, Walter Bright wrote:

>

Great! Seems like it has improved substantially since I wrote the proposal a couple years ago.

What are its shortcomings presently?

You're more than smart enough to figure it out yourself, just read the docs. std.sumtype is well documented.

For the record, std.sumtype has had no substantial changes made to it since Walter posted his original proposal on November 28th, 2022. This can easily be seen by viewing the git history:

https://github.com/dlang/phobos/commits/master/std/sumtype.d

September 11
Paul Backus kirjoitti 11.9.2024 klo 17.34:
> 
> For the record, `std.sumtype` has had no substantial changes made to it since Walter posted his original proposal on November 28th, 2022. This can easily be seen by viewing the git history:
> 
> https://github.com/dlang/phobos/commits/master/std/sumtype.d

I suspect he might be confusing it with the old `std.variant : Algebraic`. That would explain why he thought your sum type has shortcomings it actually doesn't.
September 11

On Tuesday, 10 September 2024 at 04:06:16 UTC, Walter Bright wrote:

>

https://github.com/WalterBright/documents/blob/96bca2f9f3520cf53ed5c4dec8e5e2d855e64e66/sumtype.md

Thanks!

You should standardize on using either of "sumtypes" or "sum type" but not both. According to https://en.wikipedia.org/wiki/Algebraic_data_type the latter seems preferable.

September 15
On Tuesday, 10 September 2024 at 04:06:16 UTC, Walter Bright wrote:
> https://github.com/WalterBright/documents/blob/96bca2f9f3520cf53ed5c4dec8e5e2d855e64e66/sumtype.md
>
>
> I wrote that some time ago back in November 2022. The idea is to have a sumtypes proposal, followed by a match proposal.

Really not keen on this version of sum types.
First of all, the comma-separated syntax of enum declarations sucks. You can’t use any conditional compilation, and there’s no room for allowing member functions or constructors. Look at how Swift does this better. It’s important to get a feature like this right, or else we’ll have to live with the consequences of yet another dud language feature. For instance, many people agree that enums were a dud feature, and that they should’ve just been proper sum types like in Swift. Therefore, this DIP repeating the mistakes of D’s enum is unacceptable.
Second, the query operator is a waste of a token. The new operator isn’t applicable to other language features, making it feel like an ugly special case.
I think we’d be much better off with Rikki’s version of sum types, as they do not possess the aforementioned deficiencies, and have several other improvements over this DIP’s version of sum types.
September 19

On Tuesday, 10 September 2024 at 04:06:16 UTC, Walter Bright wrote:

>

https://github.com/WalterBright/documents/blob/96bca2f9f3520cf53ed5c4dec8e5e2d855e64e66/sumtype.md

I wrote that some time ago back in November 2022. The idea is to have a sumtypes proposal, followed by a match proposal.

Previous discussions:

https://www.digitalmars.com/d/archives/digitalmars/D/sumtypes_for_D_366242.html

https://www.digitalmars.com/d/archives/digitalmars/D/Sum_type_the_D_way_366389.html

https://www.digitalmars.com/d/archives/digitalmars/D/draft_proposal_for_Sum_Types_for_D_366307.html

Is there a reason you mention Boost’s variant, but not not C++17’s std::variant?

1 2 3
Next ›   Last »