[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Out-of-range subsequences
> From: Daniels.pa@Xerox.COM
> In particular, is (subseq #(1 2 3) 0 5) an error?
Well, I agree that it ought to be clarified, so that we all to
the same thing. I'm less sure that I agree it should signal
an error, since the user could reasonably want to take
a subsequence beginning at a certain point and running up
to a certain length or the end of the strnig, whichever
comes first. If subseq is allowed to stop at end-of-string
you can do that (although the endpoint dangling out in space
is an unpretty way of specifying what you mean as a length).
If you clarify it to require and in bounds endpoint, you need
to do two operations. No big deal, but I don't think many
users would find it confusing that the operation stops at
end of string if the endpoint is out of bounds.
I'd prefer the clarification to say that the subsequence
extends to the end of the sequence or to the specified endpoint,
whichever is less, but it's not a big deal if the universal
preference is for pickiness over (marginal) convenience.
gould/csd - urbana