and
The
and
filter is a binary infix
filter that matches a position only if the filter to its left and the filter its right each
match the position.
Thus, if
left
and
right
are filters, then
left and right
matches a position exactly when the
compound filter
{left right}
matches the position. For example:
power △>5 and power ▲<3
Whether to use
and
or a compound filter is a matter of taste. One difference is that the compound filter sometimes returns a value
but the
and
filter never does.
Examples
The file
movedblackpieceecho.cql uses
and
in the line
x==Mover and source:(x&_)
This particular expression is true only if the set variable
x
has the same value as
Mover
, and the
x
intersects
the set of empty squares in the position represented by
source
(see the
: operator for a description of the meaning
of the
:
here).