develooper Front page | perl.perl6.language | Postings from June 2004

Re: more than one modifier

Thread Previous | Thread Next
From:
Luke Palmer
Date:
June 25, 2004 12:11
Subject:
Re: more than one modifier
Message ID:
20040625190824.GA3278@babylonia.flatirons.org
Juerd writes:
> Stéphane Payrard skribis 2004-06-25 16:15 (-0400):
> > It is unpossible to stack loop modifiers without adding
> > conventions denoting the iterators.
> 
> Is it really? I've always thought this would be useful enough:
> 
>     say .{foo} for @$_ for @foo;
> 
> Although that can probably just be written as:
> 
>     say .{foo} for @<<@foo;  # Looks strange. Is this correct?

Not so sure, but maybe.  It certainly looks weird. 

I like to think of hyperoperators in terms of map.  So for some unary
operator §:

    §«@x

Is equivalent to:

    map { §$_ } @x

So it appears that:

    say .{foo} for @«@foo;

Would work, but I'd be much more comfortable with:

    say .{foo} for *«@foo;

For reasons I can't describe. :-)

Luke

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