Lua and Python's "not quite" ternary operator
hisham.hm
hisham.hm
expr if cond else expr result = if cond: expr else: expr result = cond then expr1 else expr2
(Except that it's harder to read, which is why Python doesn't have that.)IMNHSO, precisely for the reason you mention, that would be much more of a hack.