Re: Class name clashing
| From: | Greg Beaver | Date: | Fri, 09 Mar 2007 22:48:51 +0000 |
| Subject: | Re: Class name clashing | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-28313@lists.php.net to get a copy of this message | ||
Stanislav Malyshev wrote:
> No it isn't. I can see no single serious reason why the class must be
> named Case or you have to move to Smalltalk or give up OOP altogether.
> It's a minuscule annoyance at best.
>
>> Anyway, I write so that perhaps, maybe, just maybe, someone might want
>> to see whats involved instead of simply writing off this request....
>
> What's involved is probably changing language parser, not sure even
> current flex/yacc combo can do it.
sure. All that would be needed is a new rule for each keyword:
T_CLASS T_CASE
in addition to
T_CLASS T_STRING
PITA, but possible :). Also possible with flex would be to enter a new
state when T_CLASS is found, and return T_STRING for any text. However,
I wouldn't want to be the one who implements this, when you can simply
add a _ to the class name or use a longer descriptive classname like
"UseCase" or "CaseOfVodka" or whatever kind of "case" you're
actually
modeling.
:)
Greg