Regular map will create a sequence, not another array so you'd have to convert the result back into an array. amap does it all "in place" and it achieves that by allowing you to specify an expression that can contain a loop variable, the original array and, potentially, the new result array. In order to write that expression, you need to know the names of the result and index variable. That's why it's a macro that lets you specify variable names. Does that help?
Joined: Aug 30, 2005
Thanks --- Yeah that helps...
.... But if the point of amap is that its "in place", why do you need to specify two arrays ? In place algorithms only need one location to store the data, by their very definition....
I could elaborate, but I think you see where I'm going with this ----