Conditional expansion
Determining if an expression should be expanded is supported with Boolean logic in generator expressions. While this is a great feature, its syntax can be inconsistent and difficult to read due to legacy reasons. It's available in two forms. The first form supports both happy and sad paths:
$<IF:condition,true_string,false_string>
The IF
expression relies on nesting to be useful: you can replace any of the arguments with another expression and produce quite complex evaluations (you can even nest one IF
condition in another). This form requires exactly three arguments, so we can't omit anything. Our best option to skip a value in case of an unmet condition is the following:
$<IF:condition,true_string,>
There’s a shorthand version that allows you to skip IF
keyword and the comma:
$<condition:true_string>
As you can see, it breaks the convention of providing the EXPRESSION
name as the first token. I assume that the intention...