3 ;;; Copyright (c) 2005--2007, by A.J. Rossini <blindglobe@gmail.com>
4 ;;; See COPYRIGHT file for any additional restrictions (BSD license).
5 ;;; Since 1991, ANSI was finally finished. Edited for ANSI Common Lisp.
9 (defpackage :lisp-stat-types
11 (:export fixnump check-nonneg-fixnum check-one-fixnum
12 check-one-real check-one-number
17 (in-package :lisp-stat-types
)
19 ;;; Type Checking Functions
20 ;;; (Moved out of lsbasics.lsp, placed there by initial design).
24 Returns T if X is a fixnum; NIL otherwise."
25 (declare (inline typep
))
28 (defun check-nonneg-fixnum (x)
29 (if (and (fixnump x
) (<= 0 x
))
31 (error "not a non-negative fixnum")))
33 (defun check-one-fixnum (x)
35 (error "not a fixnum - ~a" x
)))
37 (defun check-one-real (a)
38 (if (not (or (rationalp a
) (floatp a
)))
39 (error "not a real number ~s" a
)
42 (defun check-one-number (a)
44 (error "not a number ~s" a
)