in reply to Template Toolkit, Default and Zero

did i over simplify, or does this work for you?
[% x = f( z == 1 ? 0 : 1 ) %]
Also note that besides the ternary operator you can also use the "reverse" condition syntax, just like perl... e.g. [$ SET n = 0 IF z = 1 %] is valid TT syntax.