From 4edc552dfcaa4a7776c59d3e3c5b7cf3a972eeb6 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 2 Aug 2024 09:48:44 -0700 Subject: [PATCH] Codegen floe positions in #%deforestable The function positions in deforestable operations are Racket expr positions, but we want them to be Qi floe positions instead. This modifies the code generation step to recursively invoke codegen on these nested floe positions. --- qi-lib/flow/core/compiler/1000-qi0.rkt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qi-lib/flow/core/compiler/1000-qi0.rkt b/qi-lib/flow/core/compiler/1000-qi0.rkt index af40437f..bd2fe944 100644 --- a/qi-lib/flow/core/compiler/1000-qi0.rkt +++ b/qi-lib/flow/core/compiler/1000-qi0.rkt @@ -397,19 +397,19 @@ the DSL. (syntax-parse stx [((~datum #%deforestable) ((~datum filter) proc:clause)) #'(lambda (v) - (filter proc v))] + (filter (qi0->racket proc) v))] [((~datum #%deforestable) ((~datum filter-map) proc:clause)) #'(lambda (v) - (filter-map proc v))] + (filter-map (qi0->racket proc) v))] [((~datum #%deforestable) ((~datum map) proc:clause)) #'(lambda (v) - (map proc v))] + (map (qi0->racket proc) v))] [((~datum #%deforestable) ((~datum foldl) proc:clause init:expr)) #'(lambda (v) - (foldl proc init v))] + (foldl (qi0->racket proc) init v))] [((~datum #%deforestable) ((~datum foldr) proc:clause init:expr)) #'(lambda (v) - (foldr proc init v))] + (foldr (qi0->racket proc) init v))] [((~datum #%deforestable) ((~datum range) arg:expr ...)) #'(lambda () (range arg ...))]