Skip to content

Commit

Permalink
Codegen floe positions in #%deforestable
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
countvajhula committed Aug 3, 2024
1 parent a6078b8 commit dc6c29b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions qi-lib/flow/core/compiler/1000-qi0.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ...))]
Expand Down

0 comments on commit dc6c29b

Please sign in to comment.