You can use map, but the syntax is slightly different:
-
(i,j,v) -> v/(i*j)is an anonymous function with three arguments, butzip(x, y, z)creates three tuples which map then passes to the function.
To make the example work, either
- pass an anonymous function with a single argument destructuring into a three tuple:
map(((i,j,v),) -> v/(i*j), zip([1,2],[10,20],[100,200])) - or just pass all vectors as individual arguments to map (it will then call the function on three arguments instead of zipping them into three tuples):
map((i,j,v) -> v/(i*j), [1,2],[10,20],[100,200])