[movitz-cvs] CVS update: movitz/losp/muerte/typep.lisp

Frode Vatvedt Fjeld ffjeld at common-lisp.net
Wed Nov 24 10:08:30 UTC 2004


Update of /project/movitz/cvsroot/movitz/losp/muerte
In directory common-lisp.net:/tmp/cvs-serv4738

Modified Files:
	typep.lisp 
Log Message:
Added better type-spec rational

Date: Wed Nov 24 11:08:29 2004
Author: ffjeld

Index: movitz/losp/muerte/typep.lisp
diff -u movitz/losp/muerte/typep.lisp:1.38 movitz/losp/muerte/typep.lisp:1.39
--- movitz/losp/muerte/typep.lisp:1.38	Thu Nov 18 10:28:52 2004
+++ movitz/losp/muerte/typep.lisp	Wed Nov 24 11:08:28 2004
@@ -9,7 +9,7 @@
 ;;;; Created at:    Fri Dec  8 11:07:53 2000
 ;;;; Distribution:  See the accompanying file COPYING.
 ;;;;                
-;;;; $Id: typep.lisp,v 1.38 2004/11/18 09:28:52 ffjeld Exp $
+;;;; $Id: typep.lisp,v 1.39 2004/11/24 10:08:28 ffjeld Exp $
 ;;;;                
 ;;;;------------------------------------------------------------------
 
@@ -574,6 +574,13 @@
 (define-simple-typep (package packagep))
 
 ;;;
+
+(define-typep rational (x &optional (lower-limit '*) (upper-limit '*))
+  (and (typep x 'rational)
+       (or (eq lower-limit '*)
+	   (<= lower-limit x))
+       (or (eq upper-limit '*)
+	   (<= x upper-limit))))
 
 (define-typep and (x &rest types)
   (declare (dynamic-extent types))





More information about the Movitz-cvs mailing list