in reply to Re: Adventures in Debugging a Perl/Tk Game
in thread Adventures in Debugging a Perl/Tk Game
But I'm comfortable using map, and I don't see anything wrong with using it in void context.
Here's a node I would refer you to: is the use of map in a void context deprecated ?, which elaborates further. In it, liz says:
...I seem to recall that map was just rewritten to check for void context and avoid the extra work if possible. That is correct. And it's in Perl 5.8.1! From the 5.8.1. perldelta: "map" in void context is no longer expensive. "map" is now context aware, and will not construct a list if called in void context.
And I particularly like Abigail-II's reply: "Think for yourself.", as well as Abigail-II's many successive comments in the thread.
Update:: I also have to mention BrowserUk's final word in the thread, which links to this:
Larry Wall (<larry {at} wall.org>) Re: grep/map in void context perl.porters-gw The argument against using an operator for other than its primary purpose strikes me the same as the old argument that you shouldn't have sex for other than procreational purposes. Sometimes side effects are more enjoyable than the originally intended effect.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Adventures in Debugging a Perl/Tk Game
by kyle (Abbot) on Jan 16, 2008 at 17:43 UTC |