(no subject)



On Nov 14, 2007 8:41 PM, John Ogilvie <ogilvie at cecm.sfu.ca> wrote:

> May I suggest that a choice of base 0 or 1 for vectors, also the numbering
> of rows and columns of matrices and arrays, might be left to the user,


Global flags are bad news in general, making it difficult for code from
different users to coexist.  The only language I can think of that allowed
the user to choose 0 or 1-based indexing is APL, but its successors J and K
have standardized on 0-based.

Of course, more modern languages let you specify the index range of every
*array* separately, but I don't think that makes sense for lists/vectors and
matrices.  I suppose you could define the matrix product of a[4:5,7:9] and
b[2:4,-2:3] either as the product of a 2x3 and 3x6, where a[4,7] corresponds
to the [1,1] position, or as the product of infinite matrices, but....

             -s