by MathMonkeyMan · 5y ago · 0 comments
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.
> 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) 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)