![]() |
| ||||||||
Navigation |
Synopsis All argument expressions are true.
Syntax
all ( Exp1, Exp2, ... )
Types
Description Yields
true when all combinations of values of Expi are true.
Examples Are all integers 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 even?
rascal>all(int n <- [1 .. 10], n % 2 == 0);
bool: false
Are all integers 0, 2, 4, 6, 8, 10 even?
rascal>all(int n <- [0, 2 .. 10], n % 2 == 0);
bool: true
Pitfalls When one of the
Expi enumerates the elements of an empty list, all always returns false :
rascal>all(int n <- [], n > 0);
bool: false
![]() |