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

Reply via email to