From: Chris Hanson Date: Sat, 9 Feb 2002 05:43:15 +0000 (+0000) Subject: Use CLOSE-SYNTAX where possible. X-Git-Tag: 20090517-FFI~2262 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=70ba322caeeff7f33697e561c94fe52243e9504b;p=mit-scheme.git Use CLOSE-SYNTAX where possible. --- diff --git a/v7/src/compiler/base/macros.scm b/v7/src/compiler/base/macros.scm index f70b5ad31..cb24f62c6 100644 --- a/v7/src/compiler/base/macros.scm +++ b/v7/src/compiler/base/macros.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: macros.scm,v 4.25 2002/02/08 03:55:01 cph Exp $ +$Id: macros.scm,v 4.26 2002/02/09 05:43:15 cph Exp $ Copyright (c) 1988-1999, 2001, 2002 Massachusetts Institute of Technology @@ -43,25 +43,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA (if (syntax-match? '((* IDENTIFIER) * EXPRESSION) (cdr form)) (let ((names (cadr form)) (body (cddr form))) - `(,(make-syntactic-closure environment '() 'BEGIN) + `(,(close-syntax 'BEGIN environment) ,@(map (let ((r-define - (make-syntactic-closure environment '() 'DEFINE))) + (close-syntax 'DEFINE environment))) (lambda (name) `(,r-define ,name))) names) - (,(make-syntactic-closure environment '() 'LET) () ,@body))) + (,(close-syntax 'LET environment) () ,@body))) (ill-formed-syntax form))))) (define-syntax define-export (rsc-macro-transformer (lambda (form environment) (cond ((syntax-match? '(IDENTIFIER EXPRESSION) (cdr form)) - `(,(make-syntactic-closure environment '() 'SET!) + `(,(close-syntax 'SET! environment) ,@(cdr form))) ((syntax-match? '((IDENTIFIER . MIT-BVL) + EXPRESSION) (cdr form)) - `(,(make-syntactic-closure environment '() 'SET!) + `(,(close-syntax 'SET! environment) ,(caadr form) - (,(make-syntactic-closure environment '() 'NAMED-LAMBDA) + (,(close-syntax 'NAMED-LAMBDA environment) ,@(cdr form)))) (else (ill-formed-syntax form)))))) diff --git a/v7/src/edwin/clsmac.scm b/v7/src/edwin/clsmac.scm index 3c5ceb9ff..24df02fb9 100644 --- a/v7/src/edwin/clsmac.scm +++ b/v7/src/edwin/clsmac.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: clsmac.scm,v 1.8 2002/02/03 03:38:54 cph Exp $ +;;; $Id: clsmac.scm,v 1.9 2002/02/09 05:37:59 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989, 1999, 2001, 2002 Massachusetts Institute of Technology ;;; @@ -44,9 +44,9 @@ (name->class (identifier->symbol superclass))) variables) ;; Load-time definition. - `(,(make-syntactic-closure environment '() 'DEFINE) + `(,(close-syntax 'DEFINE environment) ,name - (,(make-syntactic-closure environment '() 'MAKE-CLASS) + (,(close-syntax 'MAKE-CLASS environment) ',(identifier->symbol name) ,superclass ',variables))) @@ -57,7 +57,7 @@ (lambda (form environment) (let ((finish (lambda (name operation expression) - `(,(make-syntactic-closure environment '() 'CLASS-METHOD-DEFINE) + `(,(close-syntax 'CLASS-METHOD-DEFINE environment) ,name ',operation ,expression)))) @@ -69,10 +69,9 @@ (identifier? (cadr (caddr form)))) (finish (cadr form) (car (caddr form)) - `(,(make-syntactic-closure environment '() 'NAMED-LAMBDA) + `(,(close-syntax 'NAMED-LAMBDA environment) ,(caddr form) - (,(make-syntactic-closure environment '() - 'WITH-INSTANCE-VARIABLES) + (,(close-syntax 'WITH-INSTANCE-VARIABLES environment) ,(cadr form) ,(cadr (caddr form)) () @@ -96,8 +95,7 @@ (compile/subexpression self environment history select-caddr) free-names (compile/subexpression - `(,(make-syntactic-closure system-global-environment '() 'BEGIN) - ,@body) + `(,(close-syntax 'BEGIN system-global-environment) ,@body) environment history select-cddddr))) diff --git a/v7/src/runtime/defstr.scm b/v7/src/runtime/defstr.scm index 65ff84945..d64deb18d 100644 --- a/v7/src/runtime/defstr.scm +++ b/v7/src/runtime/defstr.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: defstr.scm,v 14.38 2002/02/03 03:38:55 cph Exp $ +$Id: defstr.scm,v 14.39 2002/02/09 05:40:39 cph Exp $ Copyright (c) 1988-1999, 2001, 2002 Massachusetts Institute of Technology @@ -303,7 +303,7 @@ differences: (close (parser-context/name context) context)) (define (close name context) - (make-syntactic-closure (parser-context/environment context) '() name)) + (close-syntax name (parser-context/environment context))) (define (apply-option-transformers options context) (let loop ((options options)) @@ -679,8 +679,8 @@ differences: ;;;; Code Generation (define (absolute name context) - (make-syntactic-closure (parser-context/closing-environment context) '() - `(ACCESS ,name #F))) + (close-syntax `(ACCESS ,name #F) + (parser-context/closing-environment context))) (define (accessor-definitions structure) (let ((context (structure/context structure))) diff --git a/v7/src/sf/toplev.scm b/v7/src/sf/toplev.scm index a91019caf..6cde7489e 100644 --- a/v7/src/sf/toplev.scm +++ b/v7/src/sf/toplev.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: toplev.scm,v 4.23 2002/02/03 03:38:58 cph Exp $ +$Id: toplev.scm,v 4.24 2002/02/09 05:41:31 cph Exp $ Copyright (c) 1988-2002 Massachusetts Institute of Technology @@ -270,9 +270,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA (mark-phase "Syntax") (syntax* (if (null? declarations) s-expressions - (cons (cons (make-syntactic-closure system-global-environment - '() - 'DECLARE) + (cons (cons (close-syntax 'DECLARE system-global-environment) declarations) s-expressions)) environment)) diff --git a/v7/src/sos/macros.scm b/v7/src/sos/macros.scm index 1dd96f11e..ffda5878b 100644 --- a/v7/src/sos/macros.scm +++ b/v7/src/sos/macros.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: macros.scm,v 1.13 2002/02/03 03:38:58 cph Exp $ +;;; $Id: macros.scm,v 1.14 2002/02/09 05:42:02 cph Exp $ ;;; ;;; Copyright (c) 1993-2002 Massachusetts Institute of Technology ;;; @@ -431,8 +431,7 @@ body)))) (values body (let ((l - (syntax `(,(make-syntactic-closure environment '() - 'LAMBDA) + (syntax `(,(close-syntax 'LAMBDA environment) (CALL-NEXT-METHOD) ,@body) instance-environment)))