[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: string functions
- To: Deutsch at PARC-MAXC
- Subject: Re: string functions
- From: Chris Riesbeck <Riesbeck at YALE>
- Date: Thu ,7 May 82 17:28:00 EDT
- Cc: T-Discussion at YALE
- In-reply-to: Your message of 7 May 1982 14:05 PDT
(SUBSTRING string m n) means m THROUGH N, and -1 means the right end.
I agree that too many features spoil the broth, especially of the "T
means this, NIL means this, and no argument at all means this" variety.
What I want is a convenient way to reference the right end. When I
compare both convenience AND READABILITY of
(SUBSTRING string 0 (- (STRING-LENGTH string) 2))
with
(SUBSTRING string 1 -2)
I know where my vote goes. With 1-based indexing, I can read the second
form as "from first to second-last". I have no easy way to read the first
0-based form. Perhaps there's a totally different way to look at this,
such as
(SUBSTRING string (LEFT-INDEX m) (RIGHT-INDEX n))
or something.
-------