On 2/6/07, Smylers <[EMAIL PROTECTED]> wrote:

Blair Sutton writes:

> David Green wrote:
> > In some ways, I like not having a [0] index at all: programmers may
> > be used to counting from zero, but normal humans start with first,
> > second, third, ... third last, second last,...
> My feelings are Perl 6 should stick to 0 being the index of the first
> element of a list. Otherwise we might alienate programmers from P5 and
> nearly every other language. Couldn't the first array index be
> adjusted by adding a user defined Parrot grammar definition that
> applies the transformation +1 inside [] operators instead; maybe this
> could be accessible via a Perl "use" pragma.

Hmmm, a pragma's a bit heavyweight for this; how about being able to set
this with a special global variable -- that sure sounds handy ...

I can't quite tell how serious you are  :-)

I can't see Perl 6 changing the default starting index of arrays to be
anything other than 0 because that meme is so pervasive  (look at where
substr() starts,  and how we now have $0, etc.). But I can see the need for
a pragma to help out the Pascal or Fortran programmers start all of their
arrays at something other than 0.  And I can see the need for a modifier so
that an individual array can start at an index other that 0.

just registering my tuppence,

Jonathan Scott Duff

Reply via email to