From: Matt Birkholz Date: Mon, 3 Jun 2013 15:33:57 +0000 (-0700) Subject: Fix for bug #36887: Ignore a free variable and sf fails. X-Git-Tag: release-9.2.0~173 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=405a016a8da0b1e8a2ae8808e0ef9c5244ec44b8;p=mit-scheme.git Fix for bug #36887: Ignore a free variable and sf fails. Ignoring a free variable now just causes a warning (and names the variable). --- diff --git a/src/sf/pardec.scm b/src/sf/pardec.scm index 6e5a75ae4..eae11cd7b 100644 --- a/src/sf/pardec.scm +++ b/src/sf/pardec.scm @@ -325,22 +325,35 @@ USA. ;; not actually use. (define-declaration 'IGNORABLE (lambda (block names) - (for-each (lambda (variable) - (if variable - (variable/may-ignore! variable))) - (block/lookup-names block names #f)) - '())) + (for-each (lambda (name) + (let ((variable (block/lookup-name block name #f))) + (if variable + (variable/may-ignore! variable) + (warn "ignoring IGNORABLE declaration of free variable" + name)))) + names))) ;; IGNORE causes warnings if an ignored variable actually ends ;; up being used. Mentioning the variable in a sequence will ;; have the effect of marking it IGNORED. (define-declaration 'IGNORE (lambda (block names) - (let ((variables (block/lookup-names block names #f))) - (for-each (lambda (variable) - (if variable - (variable/must-ignore! variable))) - variables) + (let ((variables + (let loop + ((names names) + (variables '())) + (if (pair? names) + (let* ((name (car names)) + (variable (block/lookup-name block name #f))) + (if variable + (begin + (variable/must-ignore! variable) + (loop (cdr names) (cons variable variables))) + (begin + (warn "ignoring IGNORE declaration of free variable" + name) + (loop (cdr names) variables)))) + variables)))) (make-declarations 'IGNORE variables 'NO-VALUES