Le 05/12/2020 à 00:24, Larry Garfield a écrit :
Greetings, denizens of Internals!
Ilija Tovilo and I have been working for the last few months on adding support
for enumerations and algebraic data types to PHP. This is a not-small task, so
we've broken it up into several stages. The first st
Le 05/12/2020 à 00:24, Larry Garfield a écrit :
Greetings, denizens of Internals!
Ilija Tovilo and I have been working for the last few months on adding support
for enumerations and algebraic data types to PHP. This is a not-small task, so
we've broken it up into several stages. The first st
Hi,
On 05.12.20 10:22, Pierre R. wrote:
I think that ::cases() should always return an array/iterable without
keys, and let userland write their own code to create hashmaps with
those when they need it. I think that having one case (non primitive
cases) that doesn't yield string keys and the o
Le 05/12/2020 à 12:14, Markus Fischer a écrit :
Hi,
On 05.12.20 10:22, Pierre R. wrote:
I think that ::cases() should always return an array/iterable without
keys, and let userland write their own code to create hashmaps with
those when they need it. I think that having one case (non primiti
Am 05.12.20, 00:25 schrieb "Larry Garfield" :
Greetings, denizens of Internals!
Ilija Tovilo and I have been working for the last few months on adding
support for enumerations and algebraic data types to PHP. This is a not-small
task, so we've broken it up into several stages. The f
On Sat, Dec 5, 2020, at 3:26 AM, Pierre R. wrote:
> Le 05/12/2020 à 00:24, Larry Garfield a écrit :
> > Greetings, denizens of Internals!
> >
> > Ilija Tovilo and I have been working for the last few months on adding
> > support for enumerations and algebraic data types to PHP. This is a
> > not
Le 05/12/2020 à 15:42, Larry Garfield a écrit :
On Sat, Dec 5, 2020, at 3:26 AM, Pierre R. wrote:
Another question, about match() behavior:
> This usage requires no modification of |match|. It is a natural
implication of the current functionality.
May be this could be the time to have a "s
On Sat, Dec 5, 2020, at 8:21 AM, Marc Bennewitz wrote:
> *dons flame-retardant suit*
>
> Hi Larry,
>
> thanks for your great initiative and hard work in this!
> I'm the author of an emulated enumeration lib [1] and really looking
> forward seeing native enumeration support in PHP.
>
> Here
(Apologies if this posts twice, I may have accidentally hit send before
I'd finished writing it)
On 05/12/2020 14:21, Marc Bennewitz wrote:
* Do cases have a stable ordinal number / position and is that accessible?
This would be very interesting on implementing an optimized EnumSet using
b
On 05/12/2020 15:08, Larry Garfield wrote:
* Are cases serializable?
`Suit::Spades === unserialize(serialize(Suit::Spades)) // true`
Right now they'd do the same as objects, so they'd serialize as an object.
Unserializing like that, though... hm, that would probably NOT still be === due
to
Hi Larry Garfield,
> Right now they'd do the same as objects, so they'd serialize as an object.
> Unserializing like that, though... hm, that would probably NOT still be ===
> due to the way PHP handles objects.
> That's probably undesireable, but I'm not sure at the moment the best way
> around
Am 05.12.20, 16:08 schrieb "Larry Garfield" :
On Sat, Dec 5, 2020, at 8:21 AM, Marc Bennewitz wrote:
>
> * How can you access a defined case value?
> Something like `Suit::Spades->value()`
At the moment it's only accessible via the ::cases() method. It may be
appropr
Am 05.12.20, 16:21 schrieb "Rowan Tommins" :
(Apologies if this posts twice, I may have accidentally hit send before
I'd finished writing it)
On 05/12/2020 14:21, Marc Bennewitz wrote:
> * Do cases have a stable ordinal number / position and is that accessible?
>This
On 05/12/2020 19:21, Marc Bennewitz wrote:
I mean on mapping something to something else defined as a single assoc array
constant.
Something like:
enum Role {
case User,
case Admin,
...
}
enum Action {
case Order_Edit,
case Order_Read,
private const BY_ROLE = [
Role
On Sat, Dec 5, 2020, at 1:21 PM, Marc Bennewitz wrote:
> > * I often use metadata in enumerations and so I would be very
> > interested to allow constants.
>
>
> Could you give an example what you mean? Metadata on individual cases is
> supported by methods, which map more clea
On Fri, Dec 4, 2020, at 5:24 PM, Larry Garfield wrote:
> Greetings, denizens of Internals!
>
> Ilija Tovilo and I have been working for the last few months on adding
> support for enumerations and algebraic data types to PHP. This is a
> not-small task, so we've broken it up into several stages
Thanks a lot for this RFC, Larry and Iliya! I can't imagine the amount of
thought and work put into this.
Enums are definitely a most-wanted PHP feature.
I played a bit with the early implementation, and love it so far. Here are
my thoughts on the RFC and the current implementation:
*Serializatio
On Fri, Dec 4, 2020 at 7:00 PM Larry Garfield wrote:
>
>
> Dec 4, 2020 7:37:51 PM Paul Crovella :
>
> > On Fri, Dec 4, 2020 at 3:25 PM Larry Garfield
> > wrote:
> >>
> >> Greetings, denizens of Internals!
> >>
> >> Ilija Tovilo and I have been working for the last few months on adding
> >> supp
18 matches
Mail list logo