? Vector Conditional¶
Replace selected items of one list with corresponding items of another
?[x;y;z]
Where
xis a boolean vectoryandzare lists of the same typex,y, andzconform
returns a new list by replacing elements of y with the elements of z when x is false.
All three arguments are evaluated.
If x, y, or z are atomic, they are repeated.
Since V2.7 2010.10.07 ?[x;y;z] works for atoms too.
Vector Conditional can be used in qSQL queries, which do not support Cond.
For multiple cases โ more than just true/false โ see Controlling evaluation.
Q for Mortals ยง10.1.3 Vector Conditional Evaluation