Robert Haas <robertmhaas@gmail.com> writes:
> Hang on, I can't be wrong (famous last words). If the negative
> indexes were 0-based, that would mean that the first element of the
> list was referenced by -0, which obviously can't be true, because 0 =
> -0. In other words, we can't be using 0-based indexing for both the
> positive and the negative values, because then 0 itself would be
> ambiguous. It's got to be that -1 is the first element of the *pds
> list, which means -- AFAICS, anyway -- that the way I phrased it is
> correct.
> Unless the indexing system actually can't reference the first element
> of *pds, and -1 means the second element. But then I think we need a
> more verbose explanation here.
Maybe what you need is a redesign. This convention seems impossibly
confusing and hence error-prone. What about using a separate bool to
indicate which list the index refers to?
regards, tom lane