Add INLINE declamations for foreign wrappers.
[iolib/alendvai.git] / base / sequence.lisp
blobd9a8e8fb06c67e71dd628638f50f4da32262730c
1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
2 ;;;
3 ;;; --- Sequence utils
4 ;;;
6 (in-package :iolib.base)
8 (defmacro check-bounds (sequence start end)
9 (with-gensyms (length)
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")
13 (unless ,end
14 (setq ,end ,length))
15 (unless (<= ,start ,end ,length)
16 (error "Wrong sequence bounds. start: ~S end: ~S" ,start ,end)))))