From fbd5863921f1c66fb0ef84cbd8466ae6b3c92ddc Mon Sep 17 00:00:00 2001 From: Nick Alexander Date: Wed, 27 Jul 2016 14:29:51 -0700 Subject: [PATCH] Resolve lookup-refs. --- src/datomish/db.cljc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/datomish/db.cljc b/src/datomish/db.cljc index f2a61ca4..e1103f15 100644 --- a/src/datomish/db.cljc +++ b/src/datomish/db.cljc @@ -315,6 +315,10 @@ (transduce conj [] initial-es)) (assoc-in report [:entities])))) +(defn- lookup-ref? [x] + (and (sequential? x) + (= (count x) 2))) + (defn > + (vec (for [[op & entity] (:entities report)] + (into [op] (for [field entity] + (if (lookup-ref? field) + (first (> initial-report (preprocess db) + (