Ternary condition truth table: v5 versus v6
Read condition ? A : B as a choice between two expressions. The table distinguishes an unavailable boolean from an unavailable number. A v5 boolean na selects B, but it remains a distinct value that na(condition) can detect. Do not translate that rule into a claim that every na expression is an accepted v6 condition.
| Condition or input | Pine v5 | Pine v6 |
|---|---|---|
| true | Selects A | Selects A |
| false | Selects B | Selects B |
| A bool variable holding na | Selects B | Cannot declare or assign this state |
| A numeric variable holding na, used directly as condition | Implicit conversion selects B | Requires an explicit bool conversion or a boolean test |
| A numeric zero, used directly as condition | Implicit conversion selects B | Requires an explicit bool conversion or a boolean test |
| A nonzero number, used directly as condition | Implicit conversion selects A | Requires an explicit bool conversion or a boolean test |
| na(value), where value is a missing float | true: selects A | true: selects A |
| condition[1] on the first dataset bar, where condition is bool | Boolean na: selects B | false: selects B |