tisp

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

commit 67a6ce0eee0870842777aa99cd5bca082830a2ed
parent 91027150a36f6859bbaa879c557bb758a64fc13a
Author: Ed van Bruggen <edvb@uw.edu>
Date:   Wed, 20 Nov 2019 22:59:41 -0800

list? only true if given nil terminated list

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

diff --git a/tibs/lib.tsp b/tibs/lib.tsp @@ -44,7 +44,7 @@ (define (macro? x) (= (type x) "macro")) (define (pair? x) (= (type x) "pair")) (define (cons? x) (and (pair? x) (not (pair? (cdr x))))) -(define (list? x) (and (pair? x) (pair? (cdr x)))) +(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?)