There is no longer a way to use _if on an entire List
Summary: For example, you can't say _if(_isEmpty, ...)
, which is terrible.
This is a regression, caused by the fix to QI.bu6oc79. That fix was correct -- the previous behavior was just plain inconsistent and broken in a number of cases. But the fix wound up breaking a lot of perfectly-reasonable code.
The current behavior is that the predicate is being applied to each element individually, and the true or false branch is being applied to each element individually.
There's a fundamental tension here: processing element-by-element is different from processing the entire List as a whole. They're both right for certain circumstances. Broadly speaking, element-by-element is more consistent with the design intent of QL, but both need to be available.
Therefore, I'm fixing this by adding an asList
parameter; if you set this to true, then it processes both the predicate and the resulting path on the List as a whole.