Refactoring.

original commit: 5b6d0ae167bd233973441c83b759470d5d31c1a8
This commit is contained in:
Vincent St-Amour 2011-07-22 16:00:02 -04:00
parent e82fd29852
commit b9d59b8fb9

View File

@ -201,18 +201,21 @@
(define orig (map list doms rngs rests drests))
(define cases
(map (compose make-Function list make-arr)
doms
(map (match-lambda ; strip filters
[(Values: (list (Result: t _ _) ...))
(-values t)]
[(ValuesDots: (list (Result: t _ _) ...) _ _)
(-values t)])
rngs)
rests drests (make-list (length doms) null)))
;; iterate in lock step over the function types we analyze and the parts
;; that we will need to print the error message, to make sure we throw
;; away cases consistently
(let loop ([cases (map (compose make-Function list make-arr)
doms
(map (match-lambda ; strip filters
[(Values: (list (Result: t _ _) ...))
(-values t)]
[(ValuesDots: (list (Result: t _ _) ...) _ _)
(-values t)])
rngs)
rests drests (make-list (length doms) null))]
(let loop ([cases cases]
;; the parts we'll need to print the error message
[parts orig]
;; accumulators