Other higher-order functions

3-argument map:

map(b, [x1,x2,x3], [y1,y2,y3]) ==> [b(x1,y1), b(x2,y2), b(x3,y3)]

 

map(+, [1,3,7], [2,9,5]) ==> [3,12,12]


map((x,y) Þ y/x, [1,3,7],[2,9,5])

 ==> [2/1, 9/3, 5/7]

 ==> [2,3,0]


map((x,y) Þ float(y)/x,   "   )

 ==> [2.0, 3.0, 0.7148]

 

To Next Slide To Previous Slide To Contents