Hello Zeev and hello Sara Saturday, February 18, 2006, 1:04:20 AM, you wrote:
> At 01:24 18/02/2006, Marcus Boerger wrote: >>Actually Sara only asked whether she could add a flag to some handlers. >>That has nothing to with anything you started to discuss from there. > Uhm, Sara asked whether she could add a flag to a specific operator > to facilitate a certain behavior, namely, the ability to make x<y and y>>x be treated differently. It has everything to do with what I > discussed from there (but not with transitivity). the point is not being able to treat them differently. The point is being able to distinguish them so the right operation is called. Btw, in c++ it is common to do things like: bool operator != (_IN Type& oth) { return !(operator == (oth)); } for < and > it means in php the user could (should we add overloading) do function __less_then($other) { return $other->__greater($this); } But before you think i want op overloading in php let me assure you that i do not want that. The reson is that it is the opposite of our beloved KISS approach. So for example sooner or later we'd reach a point where crazy stuff - really crazy stuff - nobody understands is needed. For example another view on C++. Most overloaders do checking for "has some value" or "is valid" by: operator bool () const {... } Which leads to a lot of problems. While the correct version would be: typedef MemberType ClassType::*unspecified_boolean_type; operator ClassType::*unspecified_boolean_type() { return valid ? &ClassType::member : 0; } MemberType member; And now tell me how many ppl do you know who understand the above and the implications the simple bool conversion has. Best regards, Marcus -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php