map Examples
l
map(odd, [2, 3, 4, 5, 6, 7, 8, 9])
==>
[0, 1, 0, 1, 0, 1, 0, 1]
l
map(is_prime, [2, 3, 4, 5, 6, 7, 8, 9])
==>
[1, 1, 0, 1, 0, 1, 0, 0]
l
l
square(X) = X*X;
map(square, [2, 3, 4, 5, 6, 7, 8, 9])
==>
[4, 9, 16, 25, 36, 49, 64, 81]
In rex, we can define functions
by equations this way.