[PHP-DEV] Suggestion: Namespace implementation

2007-12-27 Thread Hans Moog
Within the last few days i read some of the posts concerning the new namespace implementation and it's alleged problems. And ... I really have to say, that I do not understand whats the problem with namespaces at all. Instead, I suppose that many lost sight of the original goal of namespaces. I

[PHP-DEV] Suggestion: Namespace implementation

2007-12-27 Thread Hans Moog
Within the last few days i read some of the posts concerning the new namespace implementation and it's alleged problems. And ... I really have to say, that I do not understand whats the problem with namespaces at all. Instead, I suppose that many lost sight of the original goal of namespaces. I

RE: AW: AW: AW: [PHP-DEV] Method overloading by method signature

2007-10-16 Thread Hans Moog
>The point is that I do not see this feature at all relevant to >solving the web problem. This is where PHP needs to focus. Namespaces >help in solving the web problem, because it eases cooperation of >independent developers to supply libraries. The feature you are >proposing is solved easi

AW: AW: AW: [PHP-DEV] Method overloading by method signature

2007-10-16 Thread Hans Moog
>> And if you have more than one parameter you will name it >> methodFromStringIntegerSampleClassBoolean ?!? > >No, I would rethink my interface. Sometimes you need more than one parameter and even rethinking wouldn't "solve" this requirement. >> And how would you do the same for constructors ?!

AW: AW: [PHP-DEV] Method overloading by method signature

2007-10-16 Thread Hans Moog
- Von: Christian Schneider [mailto:[EMAIL PROTECTED] Gesendet: Di 16.10.2007 11:45 An: Hans Moog Cc: internals@lists.php.net Betreff: Re: AW: [PHP-DEV] Method overloading by method signature Hans Moog wrote: > When it would be: > > == > function xpath(DomDocument $arg) { >

AW: AW: [PHP-DEV] Method overloading by method signature

2007-10-16 Thread Hans Moog
It allows you to be strict when messing with types but it doesn't allow you to overload type hinted methods ... so this is no solution to the problem of overloading type hinted methods, is it ? -Ursprüngliche Nachricht- Von: Stanislav Malyshev [mailto:[EMAIL PROTECTED] Gesendet: Mo 15.1

AW: [PHP-DEV] Method overloading by method signature

2007-10-15 Thread Hans Moog
When it would be: == function xpath(DomDocument $arg) { return new DomXPath($arg); } function xpath(XmlTree $arg) { return new DomXPath($this->loadXML($arg->getSource(; } function xpath(string $arg) { return new DomXPath($this->loadXML($arg)); } == (since when meth

AW: AW: [PHP-DEV] Method overloading by method signature

2007-10-15 Thread Hans Moog
Yeah PHPLint is cool and very useful when you want to be strict. We do use it regularly. But it doesn't enable you to overload your methods as described because this could only be done by a native language construct or manual type checks and dispatching. I thought it would be a good idea to emb

AW: AW: [PHP-DEV] Method overloading by method signature

2007-10-14 Thread Hans Moog
Kcachegrind doesn't show the function signature in the callgraph because the parameter signature is not part of the function signature. If the parameter siganture would be moved into the function signature, kcachegrind would adept and show it. Btw: You don't have to use it if you don't want to.

AW: AW: [PHP-DEV] Method overloading by method signature

2007-10-14 Thread Hans Moog
You are missing something. Using this new feature would be voluntarily (it is optional like type hints are already). If you want to code the old way and you don't want to force coders to use your functions correctly, you could leave out typehints an check the parameters manually. But if you wa

RE: [PHP-DEV] Method overloading by method signature

2007-10-14 Thread Hans Moog
y use typehinting when he want's to offer a number of ways to use a method). -Ursprüngliche Nachricht- Von: Marcus Boerger [mailto:[EMAIL PROTECTED] Gesendet: Sonntag, 14. Oktober 2007 09:29 An: Hans Moog Cc: Alexey Zakhlestin; internals@lists.php.net Betreff: Re: AW: [PHP-DEV] Method over

AW: [PHP-DEV] Method overloading by method signature

2007-10-14 Thread Hans Moog
ilto:[EMAIL PROTECTED] Gesendet: Sonntag, 14. Oktober 2007 10:04 An: Hans Moog Cc: internals@lists.php.net Betreff: Re: [PHP-DEV] Method overloading by method signature On 10/14/07, Hans Moog <[EMAIL PROTECTED]> wrote: > It shows an error that fun1 is not implemented for the signature of the

RE: [PHP-DEV] Method overloading by method signature

2007-10-13 Thread Hans Moog
*/ var_dump($firstParam); /* * array(3) { * [0] => string(1) "b" * [1] => string(2) "c" * } */ var_dump($remainingParameters); } -Ursprüngliche Nachricht- Von: Alexey Zakhlestin [mailto:[EMAIL PROTECTED] Gesendet: Samstag, 13. Oktob

AW: [PHP-DEV] Method overloading by method signature

2007-10-13 Thread Hans Moog
t even break backward compatibility beause it is just "syntactical sugar" to checking the variable types manually and then dispatching to the right behaviour. -Ursprüngliche Nachricht- Von: Alexey Zakhlestin [mailto:[EMAIL PROTECTED] Gesendet: Samstag, 13. Oktober 2007 22:22 An:

[PHP-DEV] Method overloading by method signature

2007-10-13 Thread Hans Moog
Will method overloading by method signature be implemented in php6 or even php 5.3? Example: I think this would be a very big advantage and would help developers to write better code.