Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected behavior when bindings are used in floe positions #181

Open
countvajhula opened this issue Aug 24, 2024 · 0 comments
Open

Unexpected behavior when bindings are used in floe positions #181

countvajhula opened this issue Aug 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@countvajhula
Copy link
Collaborator

Qi binding in Racket expression

flow.rkt> (~>> (odd?) (as p) (range 10) (filter p))
; /Users/siddhartha/work/lisp/racket/qi/qi-test/tests/flow.rkt:11:16: let: duplicate identifier
;   at: p
;   in: (let ((p undefined) (p undefined) (p undefined)) (qi0->racket (thread (thread (esc (λ (p2) (set! p p2))) ground) (esc ((λ (v) (λ rest (apply v 10 (append rest (list))))) (contract (->* (real?) (real? real?) any) (range->cstream-prepare (cstream-next->li...

Expected: '(1 3 5 7 9)

Also, the expansion appears to have many duplicate bindings.

Qi binding in Qi expression

flow.rkt> (~> (odd?) (as p) (range 10) △ (pass p))
; filter: contract violation
;   expected: (any/c . -> . any/c)
;   given: #<undefined>

Expected: 1, 3, 5, 7, 9

(The error message should also implicate pass rather than filter.)

Using a Qi binding as a primitive flow

flow.rkt> (~> (odd?) (as p) p)
; compose: contract violation
;   expected: procedure?
;   given: #<undefined>
;   argument position: 1st
;   other arguments...:
;    #<procedure:composed>

Expected: arity error, 0 arguments provided to odd?, same as (odd?)

Bindings used in non-floe positions

flow.rkt> (~> (odd?) (as p) (gen p))
#<procedure:odd?>
flow.rkt> (~> (5) (as p) (gen p))
5

(works as expected)

@countvajhula countvajhula added the bug Something isn't working label Aug 24, 2024
countvajhula added a commit that referenced this issue Sep 13, 2024
One of these was resolved by the upgrade to syntax-spec-v2. Tests for
the remaining issues are left commented out.
countvajhula added a commit that referenced this issue Sep 13, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant