Fork me on GitHub
#datahike
<
2021-11-20
>
borkdude17:11:35

@whilo It seems the datalog parser in clj-kondo doesn't understand symbols in the query:

'[:find ?arity
                     :where
                     [?x :call/arity ?arity]
                     [?x :var/name assoc]
                     [?x :var/ns clojure.core]]

timo08:11:09

Hi Michiel, thanks for reporting. Should I https://github.com/lambdaforge/datalog-parser/issues/new? I've worked on the datalog-parser once. Probably I can investigate that soonish...

borkdude09:11:29

I'm not sure if symbols are valid in Datomic datalog but they are allowed in asami.

Søren Sjørup17:12:47

It seems to me symbols are allowed as data in Datomic. As i write in a later post in this channel this works in Datomic:

(q
 '[:where [?e :s plain]
   :find ?e]
 '[[1 :s plain]])

borkdude17:12:30

My example came from a #asami usage

Søren Sjørup17:12:58

I think it’s because constants are any non-variable data literal

borkdude17:12:58

Oh, you said, they were allowed, ok then

Søren Sjørup17:12:57

Source vars can also be data

(q
  '[:where [?e :s $plain]
    :find ?e]
  '[[1 :s $plain]])

borkdude17:12:03

cool so the parser should be improved then I guess

Søren Sjørup17:12:32

Yes. I’ll see if I can fix it in datascript first.

borkdude17:12:14

isn't datascript using that same parser?

Søren Sjørup17:12:51

No. But it seems the io.lambdaforge/datalog-parser is factored out of datascript at a certain point.

👍 1
timo17:12:18

Looking forward to a contribution @U021UJJ3CQ6. Happy to help if you need anything.

borkdude17:11:57

I get "Cannot parse clause", but when I change the symbols into strings, it works