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
))
14 (in-package :lisp-stat-types
)
16 ;;; Type Checking Functions
17 ;;; (Moved out of lsbasics.lsp, placed there by initial design).
21 Returns T if X is a fixnum; NIL otherwise."
22 (declare (inline typep
))
25 (defun check-nonneg-fixnum (x)
26 (if (and (fixnump x
) (<= 0 x
))
28 (error "not a non-negative fixnum")))
30 (defun check-one-fixnum (x)
32 (error "not a fixnum - ~a" x
)))
34 (defun check-one-real (a)
35 (if (not (or (rationalp a
) (floatp a
)))
36 (error "not a real number ~s" a
)
39 (defun check-one-number (a)
41 (error "not a number ~s" a
)