From feaffaa7521ec12428c729eebc3ee74fea90aff3 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Sun, 22 Jun 2014 22:03:09 -0400 Subject: [PATCH] gestalt-union* --- minimart/gestalt.rkt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/minimart/gestalt.rkt b/minimart/gestalt.rkt index 2497fd6..c3ee691 100644 --- a/minimart/gestalt.rkt +++ b/minimart/gestalt.rkt @@ -25,6 +25,7 @@ simple-gestalt gestalt-empty gestalt-empty? + gestalt-union* gestalt-union gestalt-filter gestalt-match @@ -263,9 +264,9 @@ (cons (matcher-combiner (car sa1) (car sa2)) (matcher-combiner (cdr sa1) (cdr sa2)))))) -;; Gestalt* -> Gestalt -;; Computes the union of its arguments. -(define (gestalt-union . gs) +;; (Listof Gestalt) -> Gestalt +;; Computes the union of the given gestalts. +(define (gestalt-union* gs) (if (null? gs) (gestalt-empty) (let walk ((gs gs)) @@ -273,6 +274,11 @@ [(list g) g] [(cons g rest) (gestalt-union1 g (walk rest))])))) +;; Gestalt* -> Gestalt +;; Computes the union of its arguments. +(define (gestalt-union . gs) + (gestalt-union* gs)) + ;; Gestalt Gestalt -> Gestalt ;; Computes the union of its arguments. (define (gestalt-union1 g1 g2) (gestalt-combine-straight g1 g2 (lambda (side x) x) matcher-union))