Add ability to warn about integrated operators used as arguments.
authorJoe Marshall <eval.apply@gmail.com>
Mon, 13 Jun 2011 22:42:07 +0000 (15:42 -0700)
committerJoe Marshall <eval.apply@gmail.com>
Mon, 13 Jun 2011 22:42:07 +0000 (15:42 -0700)
src/sf/subst.scm

index d3de0f61ab4753548544b765bf8097a7c92a3e93..1258c41a8a6f4d87a0ec76323b1bc50aa8966ce1 100644 (file)
@@ -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))))