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

Re: Substring & friends



An advantage of an inclusive <start> and an exclusive <end> is that
(substring s 0 (string-length s)) is the entire string.  If both
were inclusive you'd have to say (substring s 0 (-1+ (string-length s))),
which seems less convenient.  Using (- x 1) instead of (-1+ x) makes it
even harder to read.

An aside on -1+:  As Marianne Moore said, I too dislike it.  I can't
agree that it can't be pronounced, however, since I pronounce (-1+ x)
as "the predecessor of x" or "one less than x".  As Kent Pitman once
pointed out, we can pronounce things however we like.  (Kent wanted
things like EQ? to be pronounced "eek-pee".  I propose that EQ? be
pronounced "eek-hunh?", with a rising inflection.  Just kidding.)
By the way, I don't care whether 1+ and -1+ go or stay; whatever
Jonathan decides is fine with me.

Peace, Will