Jonathan Scott Duff writes:
> Excellent summary of why an explicit index is a Good Thing as compared
> to the programmer doing it himself. I think the syntax would need to
> be different though, how do you use implicit $_ and an index? (Don't
> Do That is not an answer because people will want it) Here are some
> ideas:
>
> # Gosh, let's overuse : like python! ;-)
> for $item:$index (@array) { ... }
> for :$index (@array) { ... } # $_ and counter
>
> for (@array : index($index)) { ... }
>
> for (@array) $index { ... }
I would say you can't use implicit $_ with an index; you use explicit
$_ instead.
foreach $_ $index (@array) { ... }
It's only 3 characters, and it makes for a nice consistant syntax.
--
Chris Madsen http://www.trx.com [EMAIL PROTECTED]
TRX Technology Services (214) 346-4611
- RFC 120 (v2) Implicit counter in for statements, pos... Perl6 RFC Librarian
- Re: RFC 120 (v2) Implicit counter in for statem... Christopher J. Madsen
- Re: RFC 120 (v2) Implicit counter in for st... Glenn Linderman
- Re: RFC 120 (v2) Implicit counter in for st... David L. Nicol
- Re: RFC 120 (v2) Implicit counter in fo... Christopher J. Madsen
- Re: RFC 120 (v2) Implicit counter i... Jonathan Scott Duff
- Re: RFC 120 (v2) Implicit coun... Christopher J. Madsen
- Re: RFC 120 (v2) Implicit ... Jonathan Scott Duff
- Re: RFC 120 (v2) Impli... Christopher J. Madsen
- Re: RFC 120 (v2) Implicit ... Ariel Scolnicov
- Re: RFC 120 (v2) Impli... Mike Pastore
- Re: RFC 120 (v2) Impli... David L. Nicol
- Re: RFC 120 (v2) Impli... Johan Vromans
- Re: RFC 120 (v2) Impli... Buddha Buck
- Re: RFC 120 (v2) Implicit counter in for st... Ken Fox
- Re: RFC 120 (v2) Implicit counter in fo... Graham Barr
- Re: RFC 120 (v2) Implicit counter i... Peter Scott
