www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 51f9008b9910872afb3be92c3e4914771bf54661
parent c64251cac0e8d09dcc935f873ce11093ece0bc84
Author: Stephen Chang <stchang@ccs.neu.edu>
Date:   Tue, 19 Apr 2016 16:06:09 -0400

fix bug in `reuse` to avoid conflict with ids that happen to use the same prefix

Diffstat:
Mtapl/typecheck.rkt | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tapl/typecheck.rkt b/tapl/typecheck.rkt @@ -123,13 +123,16 @@ (let* ([pre-str #,(string-append (drop-file-ext (syntax-e #'base-lang)) ":")] [pre-str-len (string-length pre-str)] [drop-pre (λ (s) (substring s pre-str-len))] - [excluded (map (compose symbol->string syntax->datum) (syntax->list #'(new ...)))]) + [excluded (map (compose symbol->string syntax->datum) (syntax->list #'(new ...)))] + [origs (map symbol->string (syntax->datum #'(x ...)))]) (λ (name) (define out-name (or (and (string-prefix? name pre-str) (drop-pre name)) name)) - (and (not (member out-name excluded)) out-name))) + (and (not (member out-name excluded)) + (member out-name origs) + out-name))) (all-from-out base-lang))))])) (define-syntax add-expected