From: Joe Marshall Date: Sun, 7 Oct 2012 19:55:57 +0000 (-0700) Subject: Make LOCAL-DECLARE a macro. X-Git-Tag: release-9.2.0~214 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=2487015663e1dd78534a0e01a875e2309ae9b04d;p=mit-scheme.git Make LOCAL-DECLARE a macro. --- diff --git a/src/runtime/mit-macros.scm b/src/runtime/mit-macros.scm index 245e5869f..549effe2f 100644 --- a/src/runtime/mit-macros.scm +++ b/src/runtime/mit-macros.scm @@ -631,6 +631,17 @@ USA. ,r-unspecific) (,r-shallow-fluid-bind ,swap! ,body ,swap!))))))) +(define-syntax :local-declare + (er-macro-transformer + (lambda (form rename compare) + compare + (syntax-check '(KEYWORD (* (IDENTIFIER * DATUM)) + FORM) form) + (let ((r-let (rename 'LET)) + (r-declare (rename 'DECLARE))) + `(,r-let () + (,r-declare ,@(cadr form)) + ,@(cddr form)))))) + (define (unspecific-expression) `(,keyword:unspecific)) diff --git a/src/runtime/mit-syntax.scm b/src/runtime/mit-syntax.scm index 17522c64b..6788ff5e5 100644 --- a/src/runtime/mit-syntax.scm +++ b/src/runtime/mit-syntax.scm @@ -332,17 +332,6 @@ USA. (lambda () (classify/declarations (cdr form) environment)))) -(define (classifier:local-declare form environment definition-environment) - (syntax-check '(KEYWORD (* (IDENTIFIER * DATUM)) + FORM) form) - (let ((body - (classify/body (cddr form) - environment - definition-environment))) - (make-expression-item - (lambda () - (output/local-declare (classify/declarations (cadr form) environment) - (compile-body-item body)))))) - (define (classify/declarations declarations environment) (map (lambda (declaration) (classify/declaration declaration environment)) diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index 494c163b4..86e925883 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -4699,7 +4699,6 @@ USA. output/lambda output/let output/letrec - output/local-declare output/named-lambda output/post-process-expression output/runtime-reference @@ -4742,7 +4741,6 @@ USA. classifier:er-macro-transformer classifier:let-syntax classifier:letrec-syntax - classifier:local-declare classifier:non-hygienic-macro-transformer classifier:rsc-macro-transformer classifier:sc-macro-transformer @@ -4785,6 +4783,7 @@ USA. (let*-syntax :let*-syntax) (letrec :letrec) (letrec* :letrec*) + (local-declare :local-declare) (quasiquote :quasiquote) (receive :receive) supported-srfi-features) diff --git a/src/runtime/syntax-definitions.scm b/src/runtime/syntax-definitions.scm index 0a1e21b5d..0378104cc 100644 --- a/src/runtime/syntax-definitions.scm +++ b/src/runtime/syntax-definitions.scm @@ -46,7 +46,6 @@ USA. (define-classifier 'ER-MACRO-TRANSFORMER classifier:er-macro-transformer) (define-classifier 'LET-SYNTAX classifier:let-syntax) (define-classifier 'LETREC-SYNTAX classifier:letrec-syntax) - (define-classifier 'LOCAL-DECLARE classifier:local-declare) (define-classifier 'NON-HYGIENIC-MACRO-TRANSFORMER classifier:non-hygienic-macro-transformer) (define-classifier 'RSC-MACRO-TRANSFORMER classifier:rsc-macro-transformer) diff --git a/src/runtime/syntax-output.scm b/src/runtime/syntax-output.scm index 272891d93..027741ef8 100644 --- a/src/runtime/syntax-output.scm +++ b/src/runtime/syntax-output.scm @@ -150,9 +150,6 @@ USA. (define (output/runtime-reference name) (output/access-reference name system-global-environment)) -(define (output/local-declare declarations body) - (make-declaration declarations body)) - (define lambda-tag:unnamed '|#[unnamed-procedure]|) (define lambda-tag:let '|#[let-procedure]|) (define lambda-tag:fluid-let '|#[fluid-let-procedure]|)