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 ...)]