-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Thanks for building Joinery! I've had a lot of fun playing around with it a little recently, it definitely opens up interesting possibilities. I ran into a couple of small issues while exploring it a little, I'm happy to separate them out into separate issues if you'd prefer.
First, modifications to the joined-map don't seem to stick when you follow joins:
(def db
{:person/id {1 {:person/name "Calvin"
:person/friends [[:person/id 2]]
:person/pet [:pet/id 1]}
2 {:person/name "Derek"
:person/friends [[:person/id 1]]}}
:pet/id {1 {:pet/name "Malcolm"
:pet/species :dog
:pet/owner [:person/id 1]}}})
(def jm (joined-map db))
(def jm2 (assoc-in jm [:pet/id 1 :pet/breed] :collie))
(= jm2 (get-in jm2 [:person/id 1 :person/pet]))
;; => falseI suspect this is because the assoc impl modifies m but not db?
Second, calling clojure.pprint/pprint on a joined map causes infinite recursion. I think that's probably fixable by implementing the simple-dispatch multimethod? This one cropped up for me because my editor pprints REPL outputs, I suspect that's a relatively common setup.
Metadata
Metadata
Assignees
Labels
No labels