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
Function Input not Evaluated in Query Rules #311
Comments
MyriaCore
changed the title
Function input not evaluated in rules
Function Input not Evaluated in Query Rules
Aug 5, 2019
Yes, seems like a bug here datascript/src/datascript/query.cljc Lines 580 to 586 in f18db4e
It tries to rename rule vars based on if symbol starts with a |
Wow, thanks for the quick response! I thought I was just doing something wrong. Is there a workaround for the time being? |
you can try explicitly pass fn as an argument to the rule. Might work, might not |
Alright, that seems to work. Thanks! (d/q '[:find ?int
:in ?intersection
:where [(?intersection #{:a :b :c} #{:c :d :e}) ?int]]
clojure.set/intersection))
;; => #{[#{:c}]}
(d/q '[:find ?int
:in % ?intersection
:where (intersection-rule ?intersection #{:a :b :c} #{:c :d :e} ?int)]
'[[(intersection-rule ?f ?s ?t ?int)
[(?f ?s ?t) ?int]]]
clojure.set/intersection))
;; => #{[#{:c}]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I could easily be missing something, but to my current understanding, the intended behavior between the two code snippets below should be identical.
The text was updated successfully, but these errors were encountered: