David Green wrote:
On 2/5/07, David Green wrote:
Then we wouldn't need * to count backwards, although it's still useful to allow us to count past the end of an array. There are all sorts of variations on this scheme, such as whether * is the last element or the one after that, etc., or whether 0 should be the first element or the last, and so on.


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.

Reply via email to