From e43521ae19da83a5e9a8bda9465e1c9d713bb280 Mon Sep 17 00:00:00 2001 From: Joe Marshall Date: Mon, 13 Jun 2011 15:42:07 -0700 Subject: [PATCH] Add ability to warn about integrated operators used as arguments. --- src/sf/subst.scm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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)))) -- 2.25.1