This takes a “where” lambda and a series of values, and evaluates to true if the lambda, when run using each value, always evaluated to true.
(all-pass: _num where _num > 1 and _num < 14, 6, 8, 12, 10, 9)is true.
is in operators can be used to quickly check if a sequence of values contains an exact value or values, you'll
often find yourself wanting to check that the values in a sequence merely resemble a kind of value - for instance, that they're positive
numbers, or strings beginning with “E”.
The (all-pass:) macro lets you perform these checks easily using a lambda, identical to that used with (find:) - simply write a “temp variable
where a condition” expression, and every value will be put into the temp variable one by one, and the condition checked for each.
Of course, if any condition should cause an error, such as checking if a number contains a number, then the error will appear.
The temp variable, which you can name anything you want, is controlled entirely by the lambda - it doesn't exist outside of it, it won't alter identically-named temp variables outside of it, and you can't manually (set:) it within the lambda.
You can refer to other variables, including other temp variables, in the
where condition. For instance, you can
(set: _name to "Eva")(all-pass: _item where _item is _name, "Evan", "Eve", "Eva"). However, for obvious reasons,
if the outer temp variable is named the same as the lambda's temp variable, it can't be referred to in the condition.