Or returns a composed predicate that represents the logical OR predicate.
(x, y P, z ...P)
| 145 | |
| 146 | // Or returns a composed predicate that represents the logical OR predicate. |
| 147 | func Or(x, y P, z ...P) P { |
| 148 | if len(z) == 0 { |
| 149 | return &BinaryExpr{ |
| 150 | Op: OpOr, |
| 151 | X: x, |
| 152 | Y: y, |
| 153 | } |
| 154 | } |
| 155 | return &NaryExpr{ |
| 156 | Op: OpOr, |
| 157 | Xs: append([]Expr{x, y}, p2expr(z)...), |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | // F returns a field expression for the given name. |
| 162 | func F(name string) *Field { |