Negative indexing and index origin 1 can co-exist. e.g.
3 1 4 2 X 'abcd'
cadb
_1 _2 _3 _4 X 'abcd'
dcba
You'd no longer be able to say that j{x is ((#x)|j){x.
Instead, j X x is (1+j+#x) X x if j<0. Not such
a big "abnormality".
----- Original Message -----
From: bill lam <[email protected]>
Date: Tuesday, July 27, 2010 19:07
Subject: Re: [Jprogramming] index origin 0
To: [email protected]
> In that case I would imagine index origin 0 can be extended to
> negative indexing, while origin 1 cannot (without causing abnormality)
> if the intend of index origin 1 is to disallow position 0.
>
> Втр, 27 Июл 2010, Roger Hui писал(а):
> > > How does APL interpret negative index for either index origin?
> >
> > No APL I know of implements negative indexing.
> > It would be a consistent extension because it'd
> > replace an error with a result.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm