develooper Front page | perl.perl5.porters | Postings from October 2014

Re: [perl #123090] Not enough arguments for map

Thread Previous | Thread Next
Jan Dubois
October 31, 2014 16:42
Re: [perl #123090] Not enough arguments for map
Message ID:
On Fri, Oct 31, 2014 at 12:25 AM, demerphq <> wrote:
> Yet most of us would prefer to see map EXPR, LIST removed in favour of map
> BLOCK list.

Seriously? I bet that would break tons of existing code. E.g. I
frequently use expressions like

    for (map lc, grep defined, @list) { ... }

And I consider this concise syntax very "perlish". :) I also find it
more readable than the block form:

    for (map { lc } grep { defined } @list) {

Anyways, I think removal of "map EXPR, LIST" would have to be enabled
by a pragma and not be the default.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About