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?

<?php
namespace namespace\namespace;
function test(){echo "1\n";}

namespace namespace;
function test(){echo "2\n";}

echo namespace\test();
?>

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

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

Reply via email to