On Fri, Jun 16, 2006 at 03:09:12PM -0400, Anthony DeRobertis wrote:

> Syntax like this would be nice:
> 
>       foreach ($i, $j, $k) (@arr) {
>               ...
>       }
> 
> The effect would be something like this:
> 
>       for ($_tmp = 0; $_tmp < @arr; $_tmp += 3) {
>               $i = $arr[$_tmp];
>               $j = $arr[$_tmp+1];
>               $k = $arr[$_tmp+2];
>               warn "non-congruant number of items in foreach" if $_tmp+2 >= 
> @arr;
>               {
>                       ...
>               }
>       }
> 
> That warning message is horrible, but... I hope that illustrates the
> idea.
> 
> Naturally, you could also use my:
> 
>       foreach (my ($i, $j, $k)) (@arr) {
>               ...
>       }
> 
> [I'm guessing the parentheses around the list of variables would make
> parsing easier. That's the only reason I've placed them there.]

Hi Anthony,

I think the best place to discuss such improvements to the language
is probably on p5p[0]. We could forward this upstream, but we'd then
just become a go-between in any ensuing discussions.

Do feel free to CC this bug in though.

Cheers,
Dominic.

[0] <http://lists.perl.org/list/perl5-porters.html>

-- 
Dominic Hargreaves | http://www.larted.org.uk/~dom/
PGP key 5178E2A5 from the.earth.li (keyserver,web,email)



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to