From ba07cc2a23cf9ae182d7d14fbbbcb2835fc5cc20 Mon Sep 17 00:00:00 2001 From: tony Date: Wed, 14 May 2008 19:15:18 +0200 Subject: [PATCH] add docs and make a bit more CL'spy, using sequence. --- lstypes.lsp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lstypes.lsp b/lstypes.lsp index 4c90c64..104eff1 100644 --- a/lstypes.lsp +++ b/lstypes.lsp @@ -6,10 +6,13 @@ (in-package :cl-user) + (defpackage :lisp-stat-types - (:use :common-lisp) - (:export fixnump check-nonneg-fixnum check-one-fixnum - check-one-real check-one-number)) + (:documentation "Provides some typeing for LispStat, but is clearly + a bit incomplete.") + (:use :common-lisp) + (:export fixnump check-nonneg-fixnum check-one-fixnum + check-one-real check-one-number)) (in-package :lisp-stat-types) @@ -18,13 +21,14 @@ (defun fixnump (x) "Args: (x) + Returns T if X is a fixnum; NIL otherwise." (declare (inline typep)) (typep x 'fixnum)) (defun check-nonneg-fixnum (x) "Ensure that x or all elts of x are non-negative fixnums." - (cond ((listp x) + (cond ((typep x 'sequence) ;; seq rather than list, allows for vector? (map 'list #'check-one-nonneg-fixnum x)) (t (check-one-nonneg-fixnum x)))) -- 2.11.4.GIT