From b76b2aa638613827dd059dc979cb17bcf89fa79a Mon Sep 17 00:00:00 2001 From: "William J. Bowman" Date: Mon, 13 Jan 2014 19:52:07 -0500 Subject: [PATCH] =?UTF-8?q?Fixed=20uses=20of=20free-identifier=3D=3F=20gua?= =?UTF-8?q?rds?= free-identifier=? expects, contrary to documentation, a syntax?, causing contract errors. (and (identifier? ...) ...) solves this. [Since the function is called only on fully expanded forms, it doesn't look like the `identifier?` tests can ever fail, but it still seems sensible to have them. -Matthew] --- .../errortrace-lib/errortrace/private/utils.rkt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/errortrace-pkgs/errortrace-lib/errortrace/private/utils.rkt b/pkgs/errortrace-pkgs/errortrace-lib/errortrace/private/utils.rkt index dbd6a80846..7cd6996cd0 100644 --- a/pkgs/errortrace-pkgs/errortrace-lib/errortrace/private/utils.rkt +++ b/pkgs/errortrace-pkgs/errortrace-lib/errortrace/private/utils.rkt @@ -8,13 +8,13 @@ (define ((count-meta-levels phase) expr) (syntax-case expr () [(bfs . exprs) - (free-identifier=? #'bfs #'begin-for-syntax phase base) + (and (identifier? #'bfs) (free-identifier=? #'bfs #'begin-for-syntax phase base)) (add1 (apply max 0 (map (count-meta-levels (add1 phase)) (syntax->list #'exprs))))] [(ds . _) - (free-identifier=? #'ds #'define-syntaxes phase base) + (and (identifier? #'ds) (free-identifier=? #'ds #'define-syntaxes phase base)) 1] [(b . exprs) - (free-identifier=? #'b #'begin phase base) + (and (identifier? #'b) (free-identifier=? #'b #'begin phase base)) (apply max 0 (map (count-meta-levels phase) (syntax->list #'exprs)))] [_ 0])) @@ -23,7 +23,7 @@ (syntax-shift-phase-level (let loop ([meta-depth meta-depth]) (let ([e ((make-syntax-introducer) - #`(#%require (for-meta #,meta-depth + #`(#%require (for-meta #,meta-depth errortrace/errortrace-key)))]) (if (zero? meta-depth) e