>From 897270714d27bb470a98c249aa67791713616b09 Mon Sep 17 00:00:00 2001 From: Evan Hanson Date: Mon, 25 Dec 2017 12:59:25 +1300 Subject: [PATCH] Use core form to quote identifiers in expansion of `require-extension' et al. This patch avoids including an unqualified `quote' in any of the forms produced by `##sys#do-the-right-thing', which can cause failures in modules that don't import the "scheme" module since a bare `quote' will be unbound in the expansion of e.g. `require-extension'. Without it, the resulting errors will generally look like this: Warning: reference to possibly unbound identifier `` Warning: reference to possibly unbound identifier `quote' Warning: suggesting one of: Warning: (import r5rs-null) Warning: (import r4rs-null) Warning: (import scheme) Warning: (import r4rs)` Fixes #1403 and #1343. --- eval.scm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/eval.scm b/eval.scm index 5242f618..f3e0d774 100644 --- a/eval.scm +++ b/eval.scm @@ -694,7 +694,7 @@ (compile (if (null? rs) '(##core#undefined) - `(##sys#require ,@(map (lambda (x) `',x) rs)) ) + `(##sys#require ,@(map (lambda (x) `(##core#quote ,x)) rs))) e #f tf cntr se) ) ) ] [(##core#require-extension) @@ -1308,7 +1308,7 @@ (impform (if comp? `(##core#declare (uses ,id)) - `(##sys#load-library ',id #f) ) + `(##sys#load-library (##core#quote ,id) #f)) impid #f) #t id) ) ((memq id ##sys#core-syntax-modules) @@ -1316,7 +1316,7 @@ (impform (if comp? `(##core#declare (uses ,id)) - `(##sys#load-library ',id #f) ) + `(##sys#load-library (##core#quote ,id) #f)) impid #t) #t id) ) ((memq id ##sys#explicit-library-modules) @@ -1325,12 +1325,12 @@ (s (and info (assq 'syntax info)))) (values `(##core#begin - ,@(if s `((##core#require-for-syntax ',id)) '()) + ,@(if s `((##core#require-for-syntax (##core#quote ,id))) '()) ,(impform (if (not nr) (if comp? `(##core#declare (uses ,id)) - `(##sys#load-library ',id #f) ) + `(##sys#load-library (##core#quote ,id) #f) ) '(##core#undefined)) impid #f)) #t id) ) ) @@ -1344,13 +1344,13 @@ (values (impform `(##core#begin - ,@(if s `((##core#require-for-syntax ',id)) '()) + ,@(if s `((##core#require-for-syntax (##core#quote ,id))) '()) ,@(if (or nr (and (not rr) s)) '() (begin (add-req id #f) `((##sys#require - ,@(map (lambda (id) `',id) + ,@(map (lambda (id) `(##core#quote ,id)) (cond (rr (cdr rr)) (else (list id)) ) ) ) ) ) ) ) impid #f) @@ -1359,7 +1359,7 @@ (add-req id #f) (values (impform - `(##sys#require ',id) + `(##sys#require (##core#quote ,id)) impid #f) #f id))))))) (cond ((and (pair? id) (symbol? (car id))) -- 2.11.0