in reply to Re^3: map in void context
in thread map in void context

To me, map means "transform one list into another list". It does that using a loop, and so it can be used more generally for looping (like the other constructs you mention), but it has a specialty.
But that's quite a private meaning you apply to map. Map is a well-known operation in programming, and it means applying a function to the elements of a list. It's the applying of the function that's the crucial part - otherwise, it would have been named differently.
I'd say the same thing about grep, which, in void context, is identical to map.
Almost. What differs between map and grep is the context they provide. map provides list context to EXPR/BLOCK, while grep provides scalar context.

Replies are listed 'Best First'.
Re^5: map in void context
by gwadej (Chaplain) on Dec 17, 2008 at 18:46 UTC

    I hate to jump in here, but I have to agree with kyle.

    My understanding on map has always been apply a function to a list to return a new list. In some languages, there is also an apply which is meant to modify the list in place.

    Since most of the places where I've seen map-like constructs (Lisp, Haskell, etc.) are functional languages. The only way they would work is by returning a new list.

    Unfortunately, Perl's map has a behavior that combines map and apply, which confuses the conversation.

    G. Wade