Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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?

C.

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

    ...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?

      C.

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

      --jwest



      -><- -><- -><- -><- -><-
      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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2020-05-31 08:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (173 votes). Check out past polls.

    Notices?