Fork me on GitHub
#untangled
<
2016-03-24
>
adambrosio01:03:55

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

ethangracer02:03:02

@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)

tony.kay03:03:49

Ooops. Did I ask a question that was not covered in the text? I’ll have to check that.

tony.kay03:03:06

Yeah, that exercise file just needs work. I threw something in in haste, and it just isn’t very good 😛

folcon03:03:12

thanks! I’ll look over it tomorrow simple_smile...

folcon13:03:21

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:

folcon13:03:55

though I changed it to look a bit better (at least I think so) :)…

folcon13:03:23

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 simple_smile… I’m wondering if anyone has anything more elegant though for dealing with recursive queries like this?

tbrooke16:03:32

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

folcon16:03:44

@tony.kay: just did the mutation exercises, they’re pretty good simple_smile...

tony.kay22:03:33

Ah, the more recent ones? Yeah, I thought those came out pretty well...esp the bits that help you understand the follow-on reads.