From b56de73c2b7226ad0b865c664f57c9a79678c28d Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Tue, 12 Feb 2002 21:17:47 +0000 Subject: [PATCH] Don't signal error from ENVIRONMENT-LOOKUP-MACRO if name is unbound. --- v7/src/runtime/syntactic-closures.scm | 19 +++++++++---------- v7/src/runtime/uenvir.scm | 9 +++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/v7/src/runtime/syntactic-closures.scm b/v7/src/runtime/syntactic-closures.scm index 1b8b050d9..96a0c3bde 100644 --- a/v7/src/runtime/syntactic-closures.scm +++ b/v7/src/runtime/syntactic-closures.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: syntactic-closures.scm,v 14.3 2002/02/12 00:30:29 cph Exp $ +;;; $Id: syntactic-closures.scm,v 14.4 2002/02/12 21:17:47 cph Exp $ ;;; ;;; Copyright (c) 1989-1991, 2001, 2002 Massachusetts Institute of Technology ;;; @@ -479,15 +479,14 @@ ;;; modified. (define (environment/lookup environment name) - (and (environment-bound? environment name) - (let ((item (environment-lookup-macro environment name))) - (cond ((or (item? item) (not item)) - item) - ;; **** Kludge to support bootstrapping. - ((procedure? item) - (non-hygienic-macro-transformer->expander item environment)) - (else - (error:wrong-type-datum item "syntactic keyword")))))) + (let ((item (environment-lookup-macro environment name))) + (cond ((or (item? item) (not item)) + item) + ;; **** Kludge to support bootstrapping. + ((procedure? item) + (non-hygienic-macro-transformer->expander item environment)) + (else + (error:wrong-type-datum item "syntactic keyword"))))) (define (environment/define environment name item) (environment-define-macro environment name item)) diff --git a/v7/src/runtime/uenvir.scm b/v7/src/runtime/uenvir.scm index cb934e2f4..d0d4182cc 100644 --- a/v7/src/runtime/uenvir.scm +++ b/v7/src/runtime/uenvir.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: uenvir.scm,v 14.54 2002/02/12 15:13:47 cph Exp $ +$Id: uenvir.scm,v 14.55 2002/02/12 21:17:30 cph Exp $ Copyright (c) 1988-1999, 2001, 2002 Massachusetts Institute of Technology @@ -156,9 +156,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA (else value)))) (define (environment-lookup-macro environment name) - (let ((value (environment-safe-lookup environment name))) - (and (macro-reference-trap? value) - (macro-reference-trap-transformer value)))) + (and (eq? 'MACRO (environment-reference-type environment name)) + (let ((value (environment-safe-lookup environment name))) + (and (macro-reference-trap? value) + (macro-reference-trap-transformer value))))) (define (environment-safe-lookup environment name) (cond ((interpreter-environment? environment) -- 2.25.1