commit a91231b194cabb4295713beda6bd8697a1d65429
parent 26b5e2d2f527d9246a92a7e5ba2ba8f75429dd9e
Author: Ed van Bruggen <edvb@uw.edu>
Date:   Wed, 17 Apr 2019 17:47:06 -0700
Add apply function, allow many arguments to disp
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tibs/lib.tsp b/tibs/lib.tsp
@@ -61,6 +61,8 @@
 (define (not x)
   (cond (x ()) (t t)))
 (define (list . rest) rest)
+(define (apply fn args)
+  (eval (cons fn args)))
 
 (define e (exp 1.))
 (define (root b p) (pow b (/ 1 p)))
@@ -76,7 +78,7 @@
         (t (* n (! (- n 1))))))
 
 (define (newline) (print "\n"))
-(define (disp x) (print x) (newline))
+(define (disp . x) (apply print x) (newline))
 (define (disp-string str)
   (cond
     ((string? str) (print "\"" str "\""))