Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Understanding the map function

by castaway (Parson)
on Jul 14, 2005 at 09:23 UTC ( #474802=note: print w/replies, xml ) Need Help??

in reply to Understanding the map function

It makes perfect sense to me, though I would probably rephrase it thusly:

Evaluates the BLOCK or EXPR for each element of LIST (locally setting $_ to each element) and returns a list of the results .

That help any?


Replies are listed 'Best First'.
Re^2: Understanding the map function
by wfsp (Abbot) on Jul 14, 2005 at 09:55 UTC

    ...returns a list value for each element of LIST...

    It took me a while to get my head 'round that. Once you do the docs make more sense.

      That would make it more confusing, to me. It already says 'evaluates something for each element in list', thus 'returns a list of the results' cant mean anything but 'list of evaluated somethings for each element in list' ... or not?


      That edit makes the definition imprecise. map can return multiple list values for each element of LIST.


      -><- -><- -><- -><- -><-
      All things are Perfect
          To every last Flaw
          And bound in accord
               With Eris's Law
       - HBT; The Book of Advice, 1:7
Re^2: Understanding the map function
by (anonymized user) (Curate) on Jul 14, 2005 at 09:25 UTC
    Thanks - I prefer your suggestion, which makes a clear overview from the beginning.

    Hmmm... though I wonder if anything makes sense provided you already know everything it is trying to say.

    One world, one people

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://474802]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2020-10-30 11:30 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (278 votes). Check out past polls.