This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-24
Channels
- # announcements (26)
- # babashka (1)
- # beginners (174)
- # calva (1)
- # cider (10)
- # clj-kondo (27)
- # clj-together (1)
- # clojars (8)
- # clojure (57)
- # clojure-australia (1)
- # clojure-czech (2)
- # clojure-europe (40)
- # clojure-germany (15)
- # clojure-nl (3)
- # clojure-serbia (6)
- # clojure-uk (11)
- # clojurescript (30)
- # conjure (2)
- # cursive (8)
- # datalog (16)
- # datomic (29)
- # emacs (33)
- # etaoin (1)
- # events (2)
- # fulcro (81)
- # funcool (2)
- # integrant (3)
- # jobs (2)
- # joker (2)
- # kaocha (15)
- # lsp (19)
- # malli (8)
- # membrane (1)
- # off-topic (57)
- # pathom (2)
- # reitit (10)
- # releases (1)
- # remote-jobs (2)
- # reveal (5)
- # shadow-cljs (14)
- # sql (11)
- # tools-deps (8)
- # vim (3)
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?@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