Re: Re: [Zend Engine 2] Re: [PHP-DEV] Re: [Zend Engine 2] namespaces ambiguity
| From: | Andi Gutmans | Date: | Mon, 01 Oct 2001 08:12:52 +0000 |
| Subject: | Re: Re: [Zend Engine 2] Re: [PHP-DEV] Re: [Zend Engine 2] namespaces ambiguity | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-66899@lists.php.net to get a copy of this message | ||
At 10:20 PM 9/30/2001 -0500, Dean Hall wrote:
----- Original Message ----- From: "George Schlossnagle" <george@mail.communityconnect.com> To: "Dean Hall" <hall@apt7.com> Cc: "Rasmus Lerdorf" <rasmus@php.net>; <php-dev@lists.php.net>; <engine2@lists.zend.com>; "Andi Gutmans" <andi@zend.com> Sent: Sunday, September 30, 2001 09.44pm Subject: Re: [Zend Engine 2] Re: [PHP-DEV] Re: [Zend Engine 2] namespaces ambiguity The point is that while those are both valid $test?FOO:BAR:BARBARA is ambiguous in that it could refer to either of those. I guess my point is that I see no problem with a parse error message here when it is ambiguous. To make it unambiguous, you would just use curly-braces like this: $test?FOO:{BAR:BARBARA} (This seems like it would need some additional functionality in the parsing engine to extend the curly-brace mechanism outside of double-quotes/heredocs -- and to constants, not just variables.)I think this might be a good idea (although I'd use regular braces :). However, I'm not sure it's possible to complain about the ambiguity so that would nuke this idea. I have to check it out though. I am OK with such an ambiguity error. What about the rest of the people?
Also, I think that namespaces should allow no spaces between namespace names and other namespace names or variable/class/constant names. e.g.: FOO : BAR : BARBARAI have also thought of this. I think I will need to scan for namespaces in the scanner. The right way to put it is the parser but then we'd allow spaces which I really don't want to do.
is illegal as a fully-qualified constant name, so the following would eliminate ambiguity as well: $test ? FOO : BAR:BARBARA;In the case of space being illegal you are right about this. Andi