From db6cd4732bef0fcb7ef5fe86cfbdfdb2fec98a8b Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 16 Sep 2022 09:21:00 -0700 Subject: [PATCH] note about optimizing "active" components of optimized expansions --- qi-lib/flow/core/compiler.rkt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qi-lib/flow/core/compiler.rkt b/qi-lib/flow/core/compiler.rkt index 0a2f1ba0..e09755cf 100644 --- a/qi-lib/flow/core/compiler.rkt +++ b/qi-lib/flow/core/compiler.rkt @@ -19,6 +19,9 @@ #`(qi0->racket #,(optimize-flow stx))) (define (optimization-pass stx) + ;; TODO: the "active" components of the expansions should be + ;; optimized, i.e. they should be wrapped with a recursive + ;; call to the optimizer (syntax-parse stx ;; restorative optimization for "all" [((~datum ~>) ((~datum ><) onex) (~datum AND)) @@ -30,7 +33,7 @@ #'(~> _0 ... (>< (~> g (if f _ ⏚))) _1 ...)] ;; merge amps in sequence [((~datum ~>) _0 ... ((~datum ><) f) ((~datum ><) g) _1 ...) - #'(~> _0 ... (>< (~> f g)) _1 ...)] ; TODO: optimizing the inner flow? + #`(~> _0 ... #,(optimization-pass #'(>< (~> f g))) _1 ...)] ;; merge pass filters in sequence [((~datum ~>) _0 ... ((~datum pass) f) ((~datum pass) g) _1 ...) #'(~> _0 ... (pass (and f g)) _1 ...)]