1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
6 (in-package :iolib.base
)
8 (defmacro check-bounds
(sequence start end
)
10 `(let ((,length
(length ,sequence
)))
11 (check-type ,start unsigned-byte
"a non-negative integer")
12 (check-type ,end
(or unsigned-byte null
) "a non-negative integer or NIL")
15 (unless (<= ,start
,end
,length
)
16 (error "Wrong sequence bounds. start: ~S end: ~S" ,start
,end
)))))