From b9d59b8fb981b66f1bacc77f37594ebe2e115381 Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Fri, 22 Jul 2011 16:00:02 -0400 Subject: [PATCH] Refactoring. original commit: 5b6d0ae167bd233973441c83b759470d5d31c1a8 --- .../typed-scheme/typecheck/tc-app-helper.rkt | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/collects/typed-scheme/typecheck/tc-app-helper.rkt b/collects/typed-scheme/typecheck/tc-app-helper.rkt index 63ac0f5f..a1e58ba9 100644 --- a/collects/typed-scheme/typecheck/tc-app-helper.rkt +++ b/collects/typed-scheme/typecheck/tc-app-helper.rkt @@ -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