Fork me on GitHub

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

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


Hi Michiel, thanks for reporting. Should I I've worked on the datalog-parser once. Probably I can investigate that soonish...


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:

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


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


Oh, you said, they were allowed, ok then

Søren Sjørup17:12:57

Source vars can also be data

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


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.


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

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


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