Re: T_IMPORT vs. T_USE
| From: | Gregory Beaver | Date: | Mon, 01 Oct 2007 19:47:53 +0000 |
| Subject: | Re: T_IMPORT vs. T_USE | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-32523@lists.php.net to get a copy of this message | ||
Andi Gutmans wrote:
> Hi Johannes, Our preference would be to stick to "import" because I
> think the perception many will have of "use" is that it also includes
> files (just based on some other languages). That said I agree that
> compatibility would be an issue here. In fact it's even somewhat of
> an issue with "namespace" which is probably also used quite a bit
> esp. in relation to XML.
>
> What I'd like to do is see if it's feasible to support reserved words
> as identifiers. It should be possible but we need to see if it makes
> sense, how it affects consistency, and if we do it what identifiers
> we'd do it for (or all?).
This would be pretty easy, in a hackish way, by adding a whole bunch of
duplicate rules T_FUNCTION T_STRING, T_FUNCTION T_IMPORT, T_FUNCTION
T_NAMESPACE and so on. A more robust way would be to move to lemon/re2c
but I'm not volunteering to do this (yet?)
:)
Greg