Jonathan Scott Duff writes:

> 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 was being completely serious in my attempt to remind folk of C<$[> in
Perl 5, how much it is despised, and that it is a mistake that Perl 6
won't be repeating.

> ... 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.

Those sort of crutches in programming languages (let's help folk who
know some other language -- meaning they end up programming in some
hybrid of the two languages) often turn out to be a mistake.  Think of
Pascal programmers #define-ing begin and end as { and } in C, or
WordBasic being 'localized' into French, or C<use English> in Perl 5.

Part of this is cos they are mostly unnecessary: there are so many
fundamental and much deeper differences between Pascal and Perl that any
Pascal programmer who's managed to learn about and cope with all the
weird and wonderful things that Perl offers isn't going to struggle with
the relatively superficial difference in array subscripts.

> And I can see the need for a modifier so that an individual array can
> start at an index other that 0.

Isn't that something shaped arrays can already do?

Smylers

Reply via email to