Open cabo opened 3 years ago
well ... treating a nodelist as an array, may lead after resolving to something like ...
'red' in [["red","green"],["red","blue"]]
Since lhs value is tested to be contained in the rhs array ... no deep search is done ... result is false
.
I'd rather say that the nodelist is a nodelist, and an array is a (JSON) array. So "in" could have different semantics, e.g., by returning the disjunction of matching the values of the nodes.
So "in" could have different semantics
In what scenarios would you want to treat a nodelist different than an array?
I tend to agree with the opening comment.
We decided not to have " in ", so this is now closed/revisit-after-base-done.
(Spin-off from #120:)
Discuss:
@.color in $..allowed_color
We make sure that the paths on the LHS only yield a single node; the paths on the RHS may yield multiple nodes and the nodelist is examined like a JSON array would be. [How do we distinguish these cases?] ➔ disallow paths that can yield multiple nodes on the in-op RHS as well.