ternary operator
Paul Rubin
phr-n2003b at NOSPAMnightsong.com
Thu Feb 6 20:41:33 EST 2003
Mike Meyer <mwm at mired.org> writes:
> You're right about Algol. No short circuiting conditionals. I don't
> remember if the "block expression" was an Algol-W ism or from Algol 60.
What exactly do you mean by "short circuiting conditionals"?
I thought it just meant something like C's ternary operator.
Algol 60 had something like that. You could say
x = if a>=0 then sqrt(a) else sqrt(-a);
which would take the square root of the absolute value of a.
Short circuiting just means the non-selected branch doesn't get evaluated.
More information about the Python-list
mailing list