From: Taylor R Campbell Date: Sun, 5 Sep 2010 18:23:04 +0000 (+0000) Subject: Work around bug that makes DECLARE and SYNTAX-RULES not mix. X-Git-Tag: 20101212-Gtk~63 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=d1c934cb1f9cc9da9410874ec0c81742106dc7c8;p=mit-scheme.git Work around bug that makes DECLARE and SYNTAX-RULES not mix. --- diff --git a/src/runtime/mit-syntax.scm b/src/runtime/mit-syntax.scm index 79fa16a1a..478122779 100644 --- a/src/runtime/mit-syntax.scm +++ b/src/runtime/mit-syntax.scm @@ -344,13 +344,13 @@ USA. (define (classifier:declare form environment definition-environment) definition-environment - (syntax-check '(KEYWORD * (SYMBOL * DATUM)) form) + (syntax-check '(KEYWORD * (IDENTIFIER * DATUM)) form) (make-declaration-item (lambda () (classify/declarations (cdr form) environment)))) (define (classifier:local-declare form environment definition-environment) - (syntax-check '(KEYWORD (* (SYMBOL * DATUM)) + FORM) form) + (syntax-check '(KEYWORD (* (IDENTIFIER * DATUM)) + FORM) form) (let ((body (classify/body (cddr form) environment diff --git a/src/runtime/syntax-declaration.scm b/src/runtime/syntax-declaration.scm index 19e4bdac5..f1cbbecc3 100644 --- a/src/runtime/syntax-declaration.scm +++ b/src/runtime/syntax-declaration.scm @@ -41,7 +41,14 @@ USA. (define (map-declaration-identifiers procedure declaration) (if (not (pair? declaration)) (error "Ill-formed declaration:" declaration)) - (let ((entry (assq (car declaration) known-declarations))) + (let* ((declaration + ;++ This is a kludge -- rather than strip syntactic closures, + ;++ it should be aware of the environment. + (if (symbol? (car declaration)) + declaration + (cons (strip-syntactic-closures (car declaration)) + (cdr declaration)))) + (entry (assq (car declaration) known-declarations))) (if (and entry (syntax-match? (cadr entry) (cdr declaration))) ((cddr entry) declaration procedure) (begin