This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-01
Channels
- # announcements (10)
- # asami (2)
- # babashka (10)
- # beginners (55)
- # biff (37)
- # calva (9)
- # cherry (1)
- # clj-kondo (11)
- # clojure (221)
- # clojure-bay-area (12)
- # clojure-europe (77)
- # clojure-hungary (3)
- # clojure-nl (5)
- # clojure-norway (12)
- # clojurescript (11)
- # cursive (1)
- # data-science (11)
- # emacs (27)
- # figwheel (3)
- # fulcro (11)
- # graphql (5)
- # helix (7)
- # honeysql (3)
- # humbleui (9)
- # interceptors (2)
- # introduce-yourself (2)
- # kaocha (12)
- # lsp (27)
- # malli (6)
- # nbb (70)
- # off-topic (6)
- # re-frame (6)
- # react (3)
- # reitit (9)
- # releases (2)
- # scittle (29)
- # shadow-cljs (26)
- # sql (13)
- # tools-deps (61)
Separate question from the above, how does one get around circular references when using the raw nc
function? Using declare
doesn't seem to play nice when reloading the namespace in the REPL.
Trying to use :componentName
to register the class in the registry but even that is evaluation order dependent...
To clarify, I have two entities that reference each other. A
has a reference to B
, and B
can also references entities of type A
. There is a circular recursion example in the docs but it isn't mutually recursive like this...
The recursion notation …
is useful for self-recursion, but mutual recursion just isn’t possible in the REPL or regular code without specifically spelling out N different things. I think if you give the concrete details of your example perhaps we can suggest a better approach.
The only code I’ve ever seen that tried to do this was something where the author was trying to generate a DOM in Fulcro. E.g. they wanted a Div defsc, which then might contain a P, etc. It was a complete mess, and of course mutually recursive in all sorts of crazy ways.
The simple solution was that the defsc was for a Node, and the query included the “type”. Then …
worked fine.
Yea I think I can actually model my problem in a way that causes the two entities to collapse into a single entity. This actually results in a cleaner model overall.
Can anybody help me out?
(datomic/start-databases
[{:com.fulcrologic.rad.attributes/identities #{:constraint/id},
:com.fulcrologic.rad.attributes/schema :production,
:com.fulcrologic.rad.attributes/type :symbol,
:com.fulcrologic.rad.attributes/qualified-key :constraint/field}]
config)
Gives me the error message Validation Failed
However
(datomic/start-databases
[{:com.fulcrologic.rad.attributes/identities #{:constraint/id},
:com.fulcrologic.rad.attributes/schema :some-random-schema < LOOK AT ME
:com.fulcrologic.rad.attributes/type :symbol,
:com.fulcrologic.rad.attributes/qualified-key :constraint/field}]
config)
This works
It could be to do with the :com.fulcrologic.rad.attributes/type :symbol
as this does work too:
(datomic/start-databases
[{:com.fulcrologic.rad.attributes/identities #{:constraint/id},
:com.fulcrologic.rad.attributes/schema :production,
:com.fulcrologic.rad.attributes/type :string,
:com.fulcrologic.rad.attributes/qualified-key :constraint/field}]
config)
Is this in RAD Demo or your own project? I have not messed with this and do not know what datomic/start-databases
is supposed to do but I know the demo works (most of the time?). Does the error include any details? E.g. in (ex-data <the error>)
?
@holyjak Sorry I missed your reply These are all the errors it gives. This is in the RAD demo.
So you have just vanilla RAD demo, run its (start) and get this error?