Greg Ewing <greg@cosc.canterbury.ac.nz> writes: > Guido: > > > I don't understand how these can be not commutative unless they have a > > side effect on the left argument > > I think he meant "not reflective". If a<b == floor(a,b) and a>b == > ceil(a,b), then clearly a<b != b>a. What's floor of two arguments? In common lisp, (floor a b) is the largest integer n such that (<= n (/ a b)), in Python it's a type error... if you meant min(a,b), then I then think the programmer who thinks "min(a,b)" is spelt "a<b" has problems we can't be expected to deal with (if min has a symbol it's /\, but never mind that). More generally, people who define their comparison operators in non-intuitive ways shouldn't really expect intuitive behaviour. I thought Guido threatened to document this fact in large letters somewhere... Cheers, M. -- Premature optimization is the root of all evil in programming. -- C.A.R. Hoare
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4