![]() |
|
Navigation |
Synopsis Reduce generated values to a single value.
Syntax
( Exp | RedExp | Gen1, Gen1, ... )
Description A reducer resembles the fold
![]() A reducer is equivalent to the following code: it = Exp;and is executed as follows:
Examples
rascal>L = [1, 3, 5, 7]; list[int]: [1,3,5,7] rascal>(0 | it + e | int e <- L); int: 16 rascal>(1 | it * e | int e <- L); int: 105 Questions
Question [1].
![]() ![]() ![]() |