This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-24
Channels
- # admin-announcements (1)
- # aws (3)
- # beginners (52)
- # boot (150)
- # braid-chat (1)
- # braveandtrue (5)
- # bristol-clojurians (2)
- # cider (21)
- # cljs-dev (1)
- # cljsfiddle (1)
- # cljsjs (5)
- # cljsrn (4)
- # clojars (3)
- # clojure (236)
- # clojure-berlin (2)
- # clojure-czech (1)
- # clojure-madison (1)
- # clojure-russia (164)
- # clojure-sdn (1)
- # clojure-sg (2)
- # clojure-uk (64)
- # clojurescript (149)
- # core-async (31)
- # cursive (33)
- # datomic (2)
- # devcards (5)
- # funcool (3)
- # hoplon (142)
- # immutant (27)
- # juxt (7)
- # lein-figwheel (6)
- # liberator (6)
- # off-topic (4)
- # om (46)
- # onyx (26)
- # parinfer (5)
- # perun (56)
- # proton (6)
- # re-frame (19)
- # reagent (1)
- # remote-jobs (12)
- # ring-swagger (17)
- # slack-help (2)
- # spacemacs (11)
- # specter (1)
- # untangled (11)
- # yada (3)
i seem to have gotten it working with ’…
, not sure when/if that’s taught, but datomic supports it here http://docs.datomic.com/pull.html#recursive-specifications
@folcon: to confirm what @adambros said, to do a recursive query in Om you have to use the '...
syntax, otherwise you'll get a stack overflow as you encountered. Om query syntax has the same specification as datomic for recursive queries (including numeric recursion limits)
Ooops. Did I ask a question that was not covered in the text? I’ll have to check that.
Yeah, that exercise file just needs work. I threw something in in haste, and it just isn’t very good 😛
ok, so that worked, though I had to change it to look a bit better, I’m wondering if there’s anything more elegant than what I ended up doing. The basic appearance I got when I finished was:
which required me to add some extra parts to the when clause. (Specifically (defui Person… (when mate (dom/ul nil (om-person mate)))))))
-> (defui Person… (when (and mate (not (vector? mate))) (dom/ul nil (om-person mate)))))))
) The exercise is a little undefined about this, but all in all I think it’s alright …
I’m wondering if anyone has anything more elegant though for dealing with recursive queries like this?
I understand that you can rewrite the parser for your database and I saw some earlier queries about doing this for SQL - I am thinking of doing this for couchdb - maybe looking at clutch and working from there - I just wanted so see if anyone else had gone down this road - I’m not sure I want to get into datomic licensing