[Greg Wilson, quoting Philip Wadler] > Tony Hoare had a nice ternary `if'. He writes > > if c then d else e > > as > > d <c> e Noting that he first wrote "if c then d else e" so it would be *clear* what the heck he was talking about. So that's exactly the point at which Python should stop. After that, it's no longer clear, just formally elegant. I love Haskell too (and thank Philip for that), but it ain't Python. > This satisfies an associative law: > > d <c> (e <c> f) = d <c> f = (d <c> e) <c> f Nobody writes nested ?: using the same condition twice; it's more interesting as an endcase absorption law. Does x <c1> (y <c2> z) = (x <c1> y) <c2> z ? Nope (e.g., suppose c1 is true and c2 is false).
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