Array my_array[0..3]={1,2,3,4}; Array my_array[-1..2]={1,2,3,4}; Although it could be a nice, truly obfuscating feature. :-)
Not that I advocate these sort of array intervalls, but...
Remember that Pascal was carried a *lot* of weight around mathematicians and for what it's worth - the ability of using negative indexing really helped students with a mathematical background.
Another great(!) and wounderfull feature was the 'in' operator in Pascal that allowed you to write
If 2 In my_array Then Begin ... End;
IIRC. I think these sort of natural constructs, in a human perspective, that really allowed Pascal to have such a huge user base.
Then again, I still get a warm fuzzy feeling inside when I see pascal code.
Hmm.. come to think of it, I don't think this was what Martin meant.
/ Peter Lundqvist (disjunkt)
Previous text:
2003-04-02 08:12: Subject: ... and thanks for all the fish
:-)
negative indices in arrays
Negative indices in arrays sounds horrible. Wasn't it in (some) Pascal or something you could decide what indices your array had?
Array my_array[1..4]={1,2,3,4}; Array my_array[0..3]={1,2,3,4}; Array my_array[-1..2]={1,2,3,4};
Although it could be a nice, truly obfuscating feature. :-)
/ Mirar