From 03751b8f34e412482af1fbcaf519c306203967fe Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Wed, 27 Feb 2013 18:25:14 -0600 Subject: [PATCH] Rackety This commit is to giure out just how much Rackety can combat rightward drift in this file (this was a region of code edited recently for other reasons) Turns out that the first hunk's rightmost column (of code, not counting comments) moved left by 39 chars and the second by 40 chars --- collects/racket/contract/private/arr-i.rkt | 84 +++++++++++----------- 1 file changed, 41 insertions(+), 43 deletions(-) diff --git a/collects/racket/contract/private/arr-i.rkt b/collects/racket/contract/private/arr-i.rkt index 5ac72f0a60..7d7b908552 100644 --- a/collects/racket/contract/private/arr-i.rkt +++ b/collects/racket/contract/private/arr-i.rkt @@ -802,21 +802,22 @@ ;; all of the non-dependent argument contracts (list (cons 'arg-names arg-exp-xs) ...) ;; all of the dependent argument contracts - (list #,@(filter values (map (λ (arg) - (and (arg/res-vars arg) - (let ([orig-vars (find-orig-vars arg args+rst)]) - #`(λ (#,@orig-vars val blame) - #,@(arg/res-vars arg) - ;; this used to use opt/direct, but opt/direct duplicates code (bad!) - (un-dep #,(syntax-property - (syntax-property - (arg/res-ctc arg) - 'racket/contract:negative-position - this->i) - 'racket/contract:contract-on-boundary - (gensym '->i-indy-boundary)) - val blame))))) - args+rst))) + (list #,@(for/list ([arg (in-list args+rst)] + #:when (arg/res-vars arg)) + (define orig-vars (find-orig-vars arg args+rst)) + (define ctc-stx + (syntax-property + (syntax-property + (arg/res-ctc arg) + 'racket/contract:negative-position + this->i) + 'racket/contract:contract-on-boundary + (gensym '->i-indy-boundary))) + #`(λ (#,@orig-vars val blame) + #,@(arg/res-vars arg) + ;; this used to use opt/direct, but + ;; opt/direct duplicates code (bad!) + (un-dep #,ctc-stx val blame)))) ;; then the non-dependent argument contracts that are themselves dependend on (list #,@(filter values (map (λ (arg/res indy-id) @@ -830,34 +831,31 @@ #`(list (cons 'res-names res-exp-xs) ...) #''()) #,(if (istx-ress an-istx) - #`(list #,@(filter values - (map (λ (arg) - (and (arg/res-vars arg) - (let ([orig-vars (find-orig-vars - arg - (append (istx-ress an-istx) args+rst))]) - (if (eres? arg) - #`(λ #,orig-vars - #,@(arg/res-vars arg) - (opt/c #,(syntax-property - (syntax-property - (arg/res-ctc arg) - 'racket/contract:positive-position - this->i) - 'racket/contract:contract-on-boundary - (gensym '->i-indy-boundary)))) - #`(λ (#,@orig-vars val blame) - ;; this used to use opt/direct, but opt/direct duplicates code (bad!) - #,@(arg/res-vars arg) - (un-dep #,(syntax-property - (syntax-property - (arg/res-ctc arg) - 'racket/contract:positive-position - this->i) - 'racket/contract:contract-on-boundary - (gensym '->i-indy-boundary)) - val blame)))))) - (istx-ress an-istx)))) + #`(list #,@(for/list ([arg (in-list + (istx-ress an-istx))] + #:when (arg/res-vars arg)) + (define orig-vars + (find-orig-vars + arg + (append (istx-ress an-istx) + args+rst))) + (define arg-stx + (syntax-property + (syntax-property + (arg/res-ctc arg) + 'racket/contract:positive-position + this->i) + 'racket/contract:contract-on-boundary + (gensym '->i-indy-boundary))) + (if (eres? arg) + #`(λ #,orig-vars + #,@(arg/res-vars arg) + (opt/c #,arg-stx)) + #`(λ (#,@orig-vars val blame) + ;; this used to use opt/direct, but + ;; opt/direct duplicates code (bad!) + #,@(arg/res-vars arg) + (un-dep #,arg-stx val blame))))) #''()) #,(if (istx-ress an-istx) #`(list #,@(filter values