commit 511cb19313aaa9feb3680417769d513401b6b680
parent 0b522ac408bcd05dfb3521afa4b683beb94e9664
Author: Ed van Bruggen <edvb@uw.edu>
Date: Thu, 2 Jan 2020 11:49:14 -0800
Add any? type function
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tibs/lib.tsp b/tibs/lib.tsp
@@ -36,9 +36,10 @@
(define (cddddr x) (cdr (cdr (cdr (cdr x)))))
;;; Types
+(define (any? x) t)
(define (void? x) (= (type x) "void"))
(define (nil? x) (= (type x) "nil"))
-(define empty? nil?)
+(define empty? nil?)
(define (integer? x) (= (type x) "integer"))
(define (decimal? x) (= (type x) "decimal"))
(define (ratio? x) (= (type x) "ratio"))
@@ -53,7 +54,7 @@
(define (list? x) (if (pair? x) (list? (cdr x)) (not x)))
(define (boolean? x) (or (= x t) (nil? x)))
(define (true? x) (= x t))
-(define false? nil?)
+(define false? nil?)
(define (rational? x) (or (integer? x) (ratio? x)))
(define (number? x) (or (rational? x) (decimal? x)))