BoolAnd returns a composed predicate that represents the logical AND predicate.
(x, y BoolP, z ...BoolP)
| 83 | |
| 84 | // BoolAnd returns a composed predicate that represents the logical AND predicate. |
| 85 | func BoolAnd(x, y BoolP, z ...BoolP) BoolP { |
| 86 | expr := &boolP{} |
| 87 | expr.done = func(name string) { |
| 88 | zs := make([]P, len(z)) |
| 89 | for i := range z { |
| 90 | zs[i] = z[i].Field(name) |
| 91 | } |
| 92 | expr.P = And(x.Field(name), y.Field(name), zs...) |
| 93 | } |
| 94 | return expr |
| 95 | } |
| 96 | |
| 97 | // BoolNot returns a predicate that represents the logical negation of the given predicate. |
| 98 | func BoolNot(x BoolP) BoolP { |