commit 3a39473fd92343a88badad72859a1096b0aa6794
parent edca12988cdedfc5846ad8ed071b2ce02e5cc4d6
Author: Ed van Bruggen <edvb@uw.edu>
Date: Mon, 23 Sep 2019 23:58:40 -0700
Add list* to create improper list
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/tibs/lib.tsp b/tibs/lib.tsp
@@ -86,6 +86,10 @@
(define first car)
(define rest cdr)
(define (list . lst) lst)
+(define (list* . lst)
+ (if (cdr lst)
+ (cons (car lst) (apply list* (cdr lst)))
+ (car lst)))
(define (last lst)
(if (cdr lst)