3 ms·
Better examples: Both If (b == 3): x = f(a) else: x = g(a) return x and if (b == 3): x = f else: x = g
by nabla9 8y ago
Better examples:
Both
If (b == 3):
x = f(a)
else:
x = g(a)
return x
and
if (b == 3):
x = f
else:
x = g
return x(a)
are equivalent to:
if (b == 3):
return f(a)
else:
return g(a)
In every example the function call is in the tail position semantically. In the the two cases syntactically. The loop construct is hidden.