Navigation
Synopsis All argument expressions are true.
Syntax all ( Exp1, Exp2, ... )
Types
Exp1 Exp2 ... all ( Exp1, Exp2, ... )
bool bool ... bool
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
Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.