pathom

:pathom: https://github.com/wilkerlucio/pathom/ & https://pathom3.wsscode.com & https://roamresearch.com/#/app/wsscode
paul931224 2021-03-24T00:02:44.049600Z

I communicate my EQL query in string, for example: "[{[:user/id 1] [:user/name]}]" then I read-string it, and I give to p.eql/process . The problem is when I try to read-string something like:

[`(save-file {::file-path "./file.txt" ::file-content "contents here"})]
then the result is not what I expected. Are there some alternatives for read-string to resolve this?

souenzzo 2021-03-24T00:33:18.053300Z

@paul931224 First, use clojure.edn/read-string. The clojure.core/read-string is a "Lisp Reader" e can evaluate things:

user=> (read-string "#=(prn :exec)")
:exec
nil
user=>
second, ::file-path is not part of edn spec, it's a clojure shortcut. In edn it should be something like :some.namespace-name/file-path If you do (pr-str [::my-kw]) it will result in the "[:user/my-kw]" string, that is a valid EDN. Some custom EDN readers like edamame allow you to read qualified keywords, but I don't think that it's a good idea for an EQL API