How about this variation? eval({1:"a_expr(args)", 0:"b_expr(args)"}[not not c]) (Posted for entertainment value only, I've never actually used anything like this in real code)