Don't reserve names in top-level environments. The revised report
authorChris Hanson <org/chris-hanson/cph>
Wed, 17 Apr 2002 15:02:21 +0000 (15:02 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 17 Apr 2002 15:02:21 +0000 (15:02 +0000)
requires that top-level definitions act like assignments when the name
is already bound.

v7/src/runtime/mit-syntax.scm

index aa1194fb1bd5969693ee4cb233e0ac60c9a6c830..7f138d27b3f7b4a834ec9e919f7d7ec254c31e37 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: mit-syntax.scm,v 14.5 2002/03/01 03:09:54 cph Exp $
+;;; $Id: mit-syntax.scm,v 14.6 2002/04/17 15:02:21 cph Exp $
 ;;;
 ;;; Copyright (c) 1989-1991, 2001, 2002 Massachusetts Institute of Technology
 ;;;
 
 (define (classify/define form environment definition-environment history
                         binding-theory)
-  (syntactic-environment/define definition-environment
-                               (cadr form)
-                               (make-reserved-name-item history))
+  (if (not (syntactic-environment/top-level? definition-environment))
+      (syntactic-environment/define definition-environment
+                                   (cadr form)
+                                   (make-reserved-name-item history)))
   (binding-theory definition-environment
                  (cadr form)
                  (classify/subexpression (caddr form)