WRITE-SEQUENCE and read-sequence don't verify that start <= end
I believe both WRITE-SEQUENCE and read-sequence should verify that start <= end
> (WRITE-SEQUENCE "ABCDEFGH" *STANDARD-OUTPUT* :END 1 :start 2)
"ABCDEFGH"
> (let ((seq (make-string 10 :initial-element #\space)))
(with-input-from-string (blah "127182187261762")
(read-sequence seq blah :start 3 :end 2)))
3
I know this is not a proof, but here the (shortende) output from sbcl
* (let ((seq (make-string 10 :initial-element #\space)))
(with-input-from-string (blah "127182187261762")
(read-sequence seq blah :start 3 :end 2)))
debugger invoked on a SB-KERNEL:BOUNDING-INDICES-BAD-ERROR in thread
#<THREAD "main thread" RUNNING {10005505B3}>:
The bounding indices 3 and 2 are bad for a sequence of length 10.
See also:
The ANSI Standard, Glossary entry for "bounding index designator"
The ANSI Standard, writeup for Issue SUBSEQ-OUT-OF-BOUNDS:IS-AN-ERROR
...
* (WRITE-SEQUENCE "ABCDEFGH" *STANDARD-OUTPUT* :END 1 :start 2)
debugger invoked on a SB-KERNEL:BOUNDING-INDICES-BAD-ERROR in thread
#<THREAD "main thread" RUNNING {10005505B3}>:
The bounding indices 2 and 1 are bad for a sequence of length 8.
See also:
The ANSI Standard, Glossary entry for "bounding index designator"
The ANSI Standard, writeup for Issue SUBSEQ-OUT-OF-BOUNDS:IS-AN-ERROR
>> (lisp-implementation-version) "16.1.3"
>> (ext:lisp-implementation-vcs-id)
"e3b9919ffaddbeb8d5f16c394fb70b813c5f0d94"
>> (software-type) "Darwin"
>> (software-version) "17.7.0"
>> (machine-type) "x86_64"
Edited by Daniel Kochmański