Re: [PHP-DEV] Adding explicit intent for SWITCH/CASE fall through?

2019-10-19 Thread Mike Schinkel
> On Oct 19, 2019, at 3:21 AM, Kris Craig wrote: > If we're going to do this, let's take the opportunity to make it even more > useful. Assuming this idea truly does have momentum, I hope we do not get so focused on the `perfect` that we postpone the `good` indefinitely. There is always next

Re: [PHP-DEV] Adding explicit intent for SWITCH/CASE fall through?

2019-10-19 Thread Mike Schinkel
> On Oct 19, 2019, at 3:05 AM, A.L.E.C wrote: > Imo, this would make more sense if fallthrough did something more, e.g. > allowing > > case X: > if (something) { > fallthrough; >} > something-else; > break; > case Y: Interesting. What would you exp

Re: [PHP-DEV] 'switch-expression' and the 'type guard' unary operator demo

2019-10-19 Thread Mike Schinkel
> On Oct 19, 2019, at 12:40 PM, Kosit Supanyo wrote: > > Hi Internals > > I've just finished an implementation of 'switch-expression' that have been > discussed recently. So I would like to present my ideas here. This is great to see that you proactively implemented this. > The basic syntax o

[PHP-DEV] 'switch-expression' and the 'type guard' unary operator demo

2019-10-19 Thread Kosit Supanyo
Hi Internals I've just finished an implementation of 'switch-expression' that have been discussed recently. So I would like to present my ideas here. The basic syntax of switch-expression in this implementation is: $result = switch ($expr) { case $cond1 => $result1, case $cond2 => $resul

Re: [PHP-DEV] Adding explicit intent for SWITCH/CASE fall through?

2019-10-19 Thread Kris Craig
On Sat, Oct 19, 2019 at 12:06 AM A.L.E.C wrote: > On 10/18/19 8:57 PM, Mike Schinkel wrote: > > Imo, this would make more sense if fallthrough did something more, e.g. > allowing > > case X: > if (something) { > fallthrough; > } > something-else; >

Re: [PHP-DEV] Adding explicit intent for SWITCH/CASE fall through?

2019-10-19 Thread A.L.E.C
On 10/18/19 8:57 PM, Mike Schinkel wrote: >> Suggestion: `next;` instead? > > I am agnostic about which word is used, so I would open up for suggestions if > others think there is a better word than `fallthrough`. > > As far as I care, it could be any of the following[1] as long as the > functi