in reply to Re: Perl's Bad Ideas
in thread Perl's Bad Ideas

Check the latest Exegesis. Looks like $#array is going away, to be replaced with @array.last
...perl6 (irrc) will have a way to do forech @list while still keeping the position in the array...
It seems that the plan is to enhance foreach so it can go through a list two elements at a time, then use the @list.kv method to get a list of alternating indexes and values.

Replies are listed 'Best First'.
Re: Re: Re: Perl's Bad Ideas
by Matts (Deacon) on Apr 06, 2002 at 08:29 UTC
    Is it just me, or does it not seem like @array.last should return the last element of the array, rather than the index of the last element?
      And there I was thinking that TheDamian suggesting it would probably be @array.end over @array.last because of the saved char...

      But more (or less :-) seriously, if @array.last did return the last element (i guess it would be an alias for  @array[-1]) would there also be an @array.first?

      Yves / DeMerphq
      ---
      Writing a good benchmark isnt as easy as it might look.