Skip to content

Commit

Permalink
Update list comparison docs (#750)
Browse files Browse the repository at this point in the history
* Update list comparison docs

* Text
  • Loading branch information
hugohills-regnosys authored May 1, 2024
1 parent 4033b6c commit 3c2e84a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/rune-modelling-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -1035,11 +1035,11 @@ vehicles

The Rune DSL supports [comparison operators](#comparison-operator) to function on lists. Comparison operators are operators that always return a boolean value. The additional keywords needed to operate on lists are:

- `contains` - returns true if every element in the right hand expression is equal to an element in the left hand expression
- (`all`/`any`) combined with comparison operators (`=`, `<>`, `<` etc.) - compares a list to a single element. Note that the single cardinality value must be on the right hand side.
- `contains` - returns true if right hand expression is a subset of the left hand expression. If the right hand expression is single cardinality, then it is equivalent to an `any =` expression.
- `disjoint` - returns true if no element in the left side expression is equal to any element in the right side expression
- (`all`/`any`) combined with comparison operators (`=`, `<>`, `<` etc.) - compares a list to a single element

If the `contains` operator is passed an expression that has single cardinality, that expression is treated as a list containing the single element or an empty list if the element is null.
If the `contains` or `disjoint` operator is passed an expression that has single cardinality, that expression is treated as a list containing the single element or an empty list if the element is null.

For the comparison operators, if either the left or right expression has multiple cardinality then the other side should have multiple cardinality. Otherwise if one side's expression has single cardinality, `all` or `any` should be used to qualify the list on the other side.

Expand Down

0 comments on commit 3c2e84a

Please sign in to comment.