Re: [RFC] Enumerations
| From: | Paul Crovella | Date: | Mon, 07 Dec 2020 01:07:38 +0000 |
| Subject: | Re: [RFC] Enumerations | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-112448@lists.php.net to get a copy of this message | ||
On Sun, Dec 6, 2020 at 7:49 AM Larry Garfield <larry@garfieldtech.com> wrote:
>
> On Sun, Dec 6, 2020, at 9:11 AM, Rowan Tommins wrote:
>
> > Note that Larry's longer term plan is for "algebraic data types",
> > including "tagged unions": Ý¿Íuh!m¦âã�Ç
> > g¦https://wiki.php.net/rfc/adts Unlike
> > straight-forward enum cases, these are not singletons, and each instance
> > has its own associated state.
>
>
> I was going to respond, but I think Rowan summed it up here.
That's disappointing as he didn't even attempt to address the majority
of my concerns.
> Stateful enums are called tagged unions, and that's a separate phase to keep the
> implementation and discussion focused for now.
I am only talking about the RFC you presented, you and Rowan are the
ones bringing up others.
> We hope to add those in the future, but for now unit and scalar enums have a ton of value unto
> themselves.
>
> --Larry Garfield
To be clear I want enums in PHP, I think most people do, which is why
I'd like to see this RFC improved.