Newsgroups: php.internals,php.internals Path: news.php.net Xref: news.php.net php.internals:41724 php.internals:41725 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28831 invoked from network); 6 Nov 2008 14:49:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Nov 2008 14:49:57 -0000 X-Host-Fingerprint: 76.84.4.101 cpe-76-84-4-101.neb.res.rr.com Received: from [76.84.4.101] ([76.84.4.101:24690] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A7/60-26261-41403194 for ; Thu, 06 Nov 2008 09:49:57 -0500 To: internals@lists.php.net,Dan Message-ID: <49130424.4040006@chiaraquartet.net> Date: Thu, 06 Nov 2008 08:50:12 -0600 User-Agent: Thunderbird 2.0.0.17 (X11/20080925) MIME-Version: 1.0 CC: Ben Davies , Steph Fox , troels knak-nielsen , Larry Garfield , internals@lists.php.net References: <4EA88C3A8A2747989925A5D21448FCE7@pc> <200811052154.29537.larry@garfieldtech.com> <98b8086f0811060150p2fb0312dj66896cb227c871ec@mail.gmail.com> <007301c93ffe$f4b5ad80$3ffc1f3e@foxbox> <029101c94004$d4564440$7d02ccc0$@com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Posted-By: 76.84.4.101 Subject: Re: [PHP-DEV] Call it: allow reserved words in a class or not? From: greg@chiaraquartet.net (Gregory Beaver) Dan wrote: > Quite. > > It does appear as though, as a group, that you're struggling with the entire > concept of namespaces. As demonstrated by this discussion, the resolution > issues, the separator farce, and so on. > > It may be due to weaknesses in the PHP engine as a whole, I don't know... > but it strikes me that most of these issues should be trivial ones, or ones > that could be eliminated simply by approaching language design decisions > with some common sense. > > In .NET, I can stick an Array class into my own namespace, extending the > System.Array type if I want to and use it in my code without issue. Why can > I not do that here? Is it simply that you're so worried about backwards > compatibility that you feel that you can't make the necessary changes to the > language to implement something fully? Hi Dan, OSS = show us a working patch and we'll consider it. Do this before saying the issues "should be trivial ones." Not too long ago I spent a significant amount of time trying to make it possible to use a few reserved words as method names or function names, and the result was a patch that made the parser and lexer significantly more complex, with lots of bugs that were very difficult to fix, and some edge cases where parsing simply failed. As an example of why your suggestion is not logically possible to implement, what should the following code print, 1 or 2? No human can tell whether you mean to call the namespace\namespace\test() function, or simply to call the test() function from the current namespace. Do you really expect a machine to do any better? Please spend at least 2 minutes carefully trying to think of an edge case before lamenting any feature in the language, otherwise your posts kill your credibility on the list and are frankly nothing other than annoying noise. Greg