4 ms·
Because that's what Guido liked, that's the answer. I don't like it much, but it's neat that the "happy" path value is a prefix of the assignment statement, i.
by MathMonkeyMan 5y ago
Because that's what Guido liked, that's the answer.
I don't like it much, but it's neat that the "happy" path value is a prefix of the assignment statement, i.e. in
x = 4 if thing() else -1
there is a prefix
x = 4
which, if the predicate is "expected," is like saying
x = value (... unless blah blah)
which, I could see some people liking (maybe Dutch people).
Let's just write everything in Scheme for God's sake JOIN US.
- jstanley 5y ago> which, if the predicate is "expected," is like saying > x = value (... unless blah blah) Except it's the opposite of that, because "if" is the opposite of "unless". It's more like saying x = value (... if blah blah)
- MathMonkeyMan 5y agoGood point. The "blah blah" in my case would have to negate the condition. x = value (... unless this isn't true, then it's blah instead) The stuff in parentheses is a caveat. Works just as well your way, and more directly. x = value (... so long as this is true, otherwise blah)