tisp

tiny lisp
git clone git://edryd.org/tisp
Log | Files | Refs | LICENSE

commit 2ba02919ba8c74ef2b877358291162ef9f4432a3
parent 4892c6efba8257742ee25271b9e3493927a27e83
Author: Ed van Bruggen <edvb@uw.edu>
Date:   Tue, 26 Nov 2019 23:04:59 -0800

Add atom? type check

Diffstat:
tibs/lib.tsp | 1+
1 file changed, 1 insertion(+), 0 deletions(-)

diff --git a/tibs/lib.tsp b/tibs/lib.tsp @@ -43,6 +43,7 @@ (define (function? x) (= (type x) "function")) (define (macro? x) (= (type x) "macro")) (define (pair? x) (= (type x) "pair")) +(define (atom? x) (not (pair? x))) (define (cons? x) (and (pair? x) (not (pair? (cdr x))))) (define (list? x) (if (pair? x) (list? (cdr x)) (not x))) (define (boolean? x) (or (= x t) (nil? x)))