From: Hallvard Tretteberg
Subject: subseq
Date: 
Message-ID: <HAL.93Sep26185702@monsun.si.no>
Hi Lispers,

MCL2.0p2 reports an index out of bounds error when evaluating
(subseq '(1 2 3) 1 6) while Allegro 4.1 happily returns (2 3).
CLtL2 doesn't say what should happen if you supply an END 
argument greater than the length of the sequence. Or am I wrong?
So what IS the correct behaviour?
--
Hallvard Traetteberg
Dept. of Knowledge Based Systems
SINTEF SI
Box 124 Blindern, 0314 Oslo 3
NORWAY

Tlf: +47 22 06 79 83 or  +47 22 06 73 00
Fax: +47 22 06 73 50
Email: ···················@si.sintef.no
From: Jim Barnett
Subject: Re: subseq
Date: 
Message-ID: <BARNETT.93Sep26132412@neutron.mcc.com>
>>>>> "HT" == Hallvard Tretteberg writes:

HT> MCL2.0p2 reports an index out of bounds error when evaluating
HT> (subseq '(1 2 3) 1 6) while Allegro 4.1 happily returns (2 3).
HT> So what IS the correct behaviour?

The general discussion of :start and :end arguments on page 390 of
CLTL2 seems to cover this case. It says: "If the 'end' argument is an
integer, it must be no greater than the active length of the
corresponding sequence." According to the general discussion of errors
on page 5, that means that "it is an error" for the :end index to be
out of bounds. This in turn means that the results are undefined and
the implementation can do whatever it pleases. So I guess that they're
both "right."

Interesting question: which behaviour do you find to be more useful?
For the most part, I'd rather find out about the error as soon as
possible, but the Allegro behaviour sure would come in handy during
demos...

- Jim