develooper Front page | perl.perl6.language | Postings from September 2005

Re: Look-ahead arguments in for loops

Thread Previous | Thread Next
From:
Mark A. Biggar
Date:
September 30, 2005 19:44
Subject:
Re: Look-ahead arguments in for loops
Message ID:
433DF7F4.4080204@biggar.org
Damian Conway wrote:
> Rather than addition Yet Another Feature, what's wrong with just using:
> 
>     for @list ¥ @list[1...] -> $curr, $next {
>         ...
>     }
> 
> ???
> 
> Damian
> 

Shouldn't that be:

for [@list, undef] ¥ @list[1...] -> $curr, $next {
         ...
}

As I remember it zip hrows away extras, not fills in with undef.

-- 
mark@biggar.org
mark.a.biggar@comcast.net


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