match: implement and*' in terms of andmap'

This commit is contained in:
Bogdan Popa 2020-11-21 14:53:05 +02:00 committed by Sam Tobin-Hochstadt
parent 7bb2cad8db
commit ec1f11e18e

View File

@ -41,12 +41,7 @@
(map (lambda (p) (f (car p) (cdr p))) ht-l)) (map (lambda (p) (f (car p) (cdr p))) ht-l))
(define (and* . vs) (define (and* . vs)
(let loop ([r #t] (andmap values vs))
[vs vs])
(cond
[(not r) r]
[(null? vs) r]
[else (loop (and r (car vs)) (cdr vs))])))
;; Produce a bool for every column in a set of rows, where #t means ;; Produce a bool for every column in a set of rows, where #t means
;; that every pat in that column is a Dummy. ;; that every pat in that column is a Dummy.