On 12/02/15 14:21, Marcio Almada wrote:
Thanks for the RFC!
We discussed a little bit with the Hoa [1]'s and fruux [2]'s community
and we have a question.
Why not pretending we have an array of symbols, something like:
    use Foo\Bar\[Baz, Qux];
instead of
    use Foo\Bar\{Baz, Qux};
This is a list vs. block debate. While I personally would go for `{` and
`}`, here we declare a list, so we guess the array syntax
would be more tailored.
Thoughts?
Hi,
Hi :-),


This is an interesting one. During research, the `[` and `]` syntax was
considered for a while but it quickly felt apart for the following reasons:

1. Most people considered on PHP the array construct is a very important
building block and therefore we should avoid to multiplex or reuse its
syntax in multiple contexts. This becomes more clear in cases involving
conflict resolutions:

use Foo\Bar\[Baz *as* Buz, Qux\Quaz *as* Quiz];
+1.


2. Block syntax seemed more versatile and prone to reuse because we already
have the traits conflict resolution syntax:

http://php.net/manual/en/language.oop5.traits.php#language.oop5.traits.conflict

The reasoning for using commas to delimit imported entities and not `;` is
that current use declaration syntax is a comma separated list:

use function foo\math\sin, foo\math\cos, foo\math\cosh;

Hence the `{..., ...}` syntax seemed the most tailored to feel similar and
obvious for most of the current PHP userbase, based on all experiments:

use function foo\math\{ sin, cos, cosh };
use function Foo\Bar\{ A, B as Baz, C };

I hope that the given information is useful to your decision process. Good
voting!
Yup sure. We are going to vote yes (behind my nickname).
However, while I agree with all your arguments, we have more syntax and more semantics, it's kind of confusing :-/. But it's a small one, so +1 for us.

--
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/

PhD. computer scientist
Hacker
http://mnt.io/


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

Reply via email to