commit c13c84f74bf57e6f19ec674f049b61740a62c7b6
parent 16b1930f4efed45f0a108ef1163bdc6f67ee4aa4
Author: Ed van Bruggen <edvb@uw.edu>
Date: Sun, 6 Oct 2019 23:56:39 -0700
Remove foreach, always use map instead
Diffstat:
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/tibs/lib.tsp b/tibs/lib.tsp
@@ -115,10 +115,6 @@
(eval (map (lambda (x)
(list 'quote x))
(cons fn args))))
-(define (foreach args fn)
- (unless (nil? args)
- (fn (car args))
- (foreach (cdr args) fn)))
(define (map fn lst)
(if lst
@@ -179,9 +175,9 @@
(define (newline) (print "\n"))
(define (disp . str) (apply print str) (newline))
(define (disp-string . str)
- (foreach str
- (lambda (s)
- (if (string? s)
- (print "\"" s "\"")
- (print s))))
+ (map (lambda (s)
+ (if (string? s)
+ (print "\"" s "\"")
+ (print s)))
+ str)
(newline))