From: Joe Marshall Date: Mon, 13 Jun 2011 22:42:07 +0000 (-0700) Subject: Add ability to warn about integrated operators used as arguments. X-Git-Tag: release-9.1.0~22^2~7 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=e43521ae19da83a5e9a8bda9465e1c9d713bb280;p=mit-scheme.git Add ability to warn about integrated operators used as arguments. --- diff --git a/src/sf/subst.scm b/src/sf/subst.scm index d3de0f61a..1258c41a8 100644 --- a/src/sf/subst.scm +++ b/src/sf/subst.scm @@ -111,7 +111,7 @@ USA. operations name (lambda (operation info) (case operation - ((#F EXPAND INTEGRATE-OPERATOR) (dont-integrate)) + ((#F EXPAND) (dont-integrate)) ((IGNORE) (ignored-variable-warning name) @@ -122,6 +122,10 @@ USA. (access/block expression) (integration-info/expression info)))) + ((INTEGRATE-OPERATOR) + (warn "Not integrating operator in access: " name) + (dont-integrate)) + (else (error "Unknown operation" operation)))) dont-integrate))))) @@ -332,6 +336,8 @@ USA. expression))) ;;;; Reference +(define sf:warn-on-unintegrated-argument #f) + (define-method/integrate 'REFERENCE (lambda (operations environment expression) (let ((variable (reference/variable expression))) @@ -347,7 +353,7 @@ USA. (ignored-variable-warning (variable/name variable)) (dont-integrate)) - ((EXPAND INTEGRATE-OPERATOR) + ((EXPAND) (dont-integrate)) ((INTEGRATE) @@ -358,6 +364,11 @@ USA. new-expression) (dont-integrate)))) + ((INTEGRATE-OPERATOR) + (if sf:warn-on-unintegrated-argument + (warn "Not integrating operator in argument position: " variable)) + (dont-integrate)) + (else (error "Unknown operation" operation))))