[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*To*: gls@ZARATHUSTRA.THINK.COM*Subject*: negative index for the sequence*From*: Hiroshi G. Okuno <Okuno@SUMEX-AIM.ARPA>*Date*: Sat 21 Jun 86 00:27:34-PDT*Cc*: common-lisp@SU-AI.ARPA*In-reply-to*: <860619212728.1.GLS@THORLAC.THINK.COM>

> Well, SUBSEQ must check the length if it is defined to SIGNAL an error for > an out-of-bound index. > > --Guy If the length check is performed in SUBSEQ, a negative index may be considered as a convention of -n == (- (length <object>) n) where n > 0. For example, (subseq #(a b c d e) -3 -1) = (subseq #(a b c d e) 2 4) = #(c d e) Of course, if the non-negative index which corresponds to a negative one exceeds the bound of the sequence, an error is signalled. This convention is very useful for string manipulations. In fact, a negative index is supported in TAO and used extensively in a kana-kanji conversion programs. - Gitchang - -------

**Follow-Ups**:**negative index for the sequence (correction)***From:*Hiroshi G. Okuno <Okuno@SUMEX-AIM.ARPA>

**References**:**out-of-range subsequences***From:*Guy Steele <gls@Think.COM>

- Prev by Date:
**Re: Namestring&pathstring returning shared structure** - Next by Date:
**Re: Common LISP meeting at Lisp Conference** - Previous by thread:
**out-of-range subsequences** - Next by thread:
**negative index for the sequence (correction)** - Index(es):