At 00:39 17/02/2006, Sara Golemon wrote:
I gave this some thought as I was designing the overloading approach. I
didn't go there because I actually wanted to allow asymmetry between the
operands as sometimes communative properties don't apply cleanly.  Most
obviously in the case of sub/div ops, but also in certain other (less
likely) spots like matrix maths. a[1,3] * b[3,1] is certainly different than
b[3,1] * a[1,3].

I'll take a look at applying this to the is_smaller op at least.  I'm not a
master mathematician, but I'm fairly certain that 2 is always greater than
1.(Cue the cue the internals@ response to the contrary)

I agree with that 'theory', I tend to think that relation operators fall in a different category from operation operators (or whatever they're called :)

x>y is pretty much by definition the same as y<x, so I don't think we need to allow for different implementations. I think you need to reconsider allowing two different object types to be compared (hence opening the possibility for inconsistent results, e.g. both x>y and x<y evaluating to true).

The rest of the operators should be compatible with non-commutative implementations.

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

Reply via email to