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

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

Thread Previous | Thread Next
From:
demerphq
Date:
October 31, 2014 16:48
Subject:
Re: [perl #123090] Not enough arguments for map
Message ID:
CANgJU+V727ZFdxqaUpD14zzRDkX4JyvS9Zy--uep0i5AszaNtQ@mail.gmail.com
On 31 October 2014 17:42, Jan Dubois <jand@activestate.com> wrote:

> On Fri, Oct 31, 2014 at 12:25 AM, demerphq <demerphq@gmail.com> 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
>

I didnt say i think its feasible. I just think its what most of us would
prefer if we had the option.


>
>     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) {
>

I dont much like either personally. Three loops for one list? But whatever.


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

I dont think we can remove it at all. I just wish we could.

Yves



-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About