]> birchwood-abbey.net Git - mit-scheme.git/commitdiff
Don't capture unbound identifiers in sealed syntactic env.
authorChris Hanson <org/chris-hanson/cph>
Thu, 18 Feb 2021 08:15:30 +0000 (00:15 -0800)
committerChris Hanson <org/chris-hanson/cph>
Sat, 20 Feb 2021 00:14:03 +0000 (16:14 -0800)
This causes lots of spurious warnings to be generated.

(cherry picked from commit 6c1081cbc39a15cf9326f8632b209fb5c856ff91)

src/runtime/syntax-environment.scm

index c701fbd3d9ca0c897af19bb37fd823501b7e6454..1fe149179387f566187fe15c6bf7b09e0c92a7d5 100644 (file)
@@ -333,12 +333,11 @@ USA.
            ((syntactic-closure? identifier) #f)
            ((environment-lookup-macro env identifier))
            (else
-            (if (not (environment-bound? env identifier))
-                (warn "Reference to unbound variable:" identifier))
-            ;; Capture free runtime references:
-            (let ((item (var-item identifier)))
-              (set! free (cons (cons identifier item) free))
-              item))))
+            (and (environment-bound? env identifier)
+                 ;; Capture free runtime references:
+                 (let ((item (var-item identifier)))
+                   (set! free (cons (cons identifier item) free))
+                   item)))))
 
     (define (store identifier item)
       (cond ((assq identifier bound)