This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-02
Channels
- # announcements (12)
- # babashka (7)
- # babashka-sci-dev (46)
- # beginners (35)
- # biff (1)
- # calva (4)
- # cider (22)
- # clj-kondo (48)
- # clj-on-windows (4)
- # clojure (132)
- # clojure-europe (161)
- # clojure-germany (1)
- # clojure-nl (2)
- # clojure-uk (5)
- # clojurescript (39)
- # conjure (10)
- # core-typed (1)
- # cursive (48)
- # datalevin (6)
- # datascript (12)
- # datomic (9)
- # emacs (5)
- # events (1)
- # figwheel-main (2)
- # honeysql (7)
- # hyperfiddle (35)
- # improve-getting-started (8)
- # introduce-yourself (4)
- # london-clojurians (1)
- # off-topic (20)
- # podcasts (1)
- # re-frame (45)
- # reitit (5)
- # releases (2)
- # rum (7)
- # shadow-cljs (20)
- # spacemacs (4)
- # tools-build (58)
- # tools-deps (19)
- # xtdb (56)
How do i use 2 rules in a single query? This throws an arity error expected 3 got 4
(d/q '[:find ...
:in $ % ?p1
:where [...]]
db rule1 rule2 p1)
this throws a parsing error
(d/q '[:find ...
:in $ % ?p1
:where [...]]
db [rule1 rule2] p1)
Can't find an example on the web for any clojure flavored datalog
Am i thinking about this wrong?I would expect the second version to work. I'm not sure what the problem is without more details. Try looking through https://github.com/tonsky/datascript/blob/master/test/datascript/test/query_rules.cljc for usage examples.
got the following
Cannot parse clause, expected (data-pattern | pred-expr | fn-expr | rule-expr | not-clause | not-join-clause | or-clause | or-join-clause) tennis
These are inherited design from Datomic hence Datascript. We will develop a more fully featured rule engine before version 1.0. Stay tuned. Right now, my priority is to finish the query engine rewrite. The rule engine will also rely on a more performant query engine.
@U0A74MRCJ thanks! looking forward to it. In this case my rule was wrong. Once i fixed it the query worked. Didn't realize i could do ors and ands. I wish there were a book on clojure's datalog dialect.