Thanks for the references. I understand Abigail-II's arguments, but I find that I agree with tilly's reply and demerphq's reply to the reply. When I see map in void context, it makes me wonder if the programmer meant something different than what's written. Was that line an assignment before? Was the returned list being used for something? Did the programmer forget something?

Not long ago, I encountered "(my $x, $y) = f()", which is equivalent to "my $x;($x, $y) = f()". As it turned out, that is what the programmer intended, but I spent quite a while finding that out, because at first glance I wondered if it was supposed to be "my ($x, $y) = f()".

(Back to map.) Given that the equivalent code (with for) is just as easy to write, the map stands out. If you're using it to get a list context (as mentioned in Re: Think for yourself.), then I think that would make an excellent comment right above.

(As a semi-side remark, in Re: Think for yourself., Abigail-II says that a familiarity with map (from experience in other languages) that predates Perl's map is some part of the reason for seeing it as just another looping construct. I, too, was using maps in Scheme before I ever saw it in Perl, so I find it interesting that I don't share that view of it.)

Thanks again for the references. It really is fascinating reading, and I recommend it to any other monk reading this.


In reply to Re^3: Adventures in Debugging a Perl/Tk Game by kyle
in thread Adventures in Debugging a Perl/Tk Game by liverpole

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.