Skip to content

Commit

Permalink
Fix binding used in a floe position in pass
Browse files Browse the repository at this point in the history
We investigated and fixed this in the Qi meeting today. It was another
"vindaloo" with currying evaluating its arguments at compile time when
the binding is still `undefined`. We fixed it in the usual way of
replacing currying with a lambda.

This is one of the issues identified in #181.
  • Loading branch information
countvajhula committed Sep 13, 2024
1 parent 44511b3 commit c458efe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
5 changes: 4 additions & 1 deletion qi-lib/flow/core/compiler.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,10 @@ the DSL.
[_:id
#'filter-values]
[(_ onex:clause)
#'(curry filter-values (qi0->racket onex))]))
#'(λ args
(apply filter-values
(qi0->racket onex)
args))]))

(define (fold-left-parser stx)
(syntax-parse stx
Expand Down
16 changes: 8 additions & 8 deletions qi-test/tests/flow.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -472,15 +472,15 @@
(filter p)))
odd?)
(list 1 3 5 7 9))
(test-equal? "binding a value used in a floe position"
((☯ (~> (as p)
(range 10)
(pass p)
▽))
odd?)
(list 1 3 5 7 9))
;; See issue #181
;; (test-equal? "binding a value used in a floe position"
;; ((☯ (~> (as p)
;; (range 10)
;; △
;; (pass p)
;; ▽))
;; odd?)
;; (list 1 3 5 7 9))
;; (test-exn "using a qi binding as a primitive flow"
;; exn:fail:contract:arity?
;; (thunk ((☯ (~> (as p) p)) odd?)))
Expand Down

0 comments on commit c458efe

Please sign in to comment.