Hi Rowan

I agree that the structure of the RFC is sub optimal. Honestly, I've
rewritten and moved things at least 5 times and it's still not good.
I'll see how I can improve it.

> so we could maybe combine them with the break keyword:
>
> $y = switch ($x) {
>      case 0:
>          break 'Foo';
>      case 1:
>          break 'Bar';
>      case 2:
>          break 'Baz';
> }

We can't really do that since break already accepts an integer telling
it how many enclosing structures it should jump out of.

> The other issues discussed in your RFC - fallthrough, inexhaustiveness,
> type coercion - are valuable things to discuss, but each one takes this
> further away from being a "switch expression", and into being "a new
> value-matching expression". As I said in my last e-mail, I don't think
> that's a bad thing; I really like the proposed syntax, as a new
> construct for picking one of a set of expressions, and would be happy to
> see the RFC re-focussed in that direction.

Yes, I can absolutely see your point. The point of the poll is to see
what direction we should take. After that I'll try to clean up the
RFC.

Thanks!
Ilija

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to