clojure - How does the not clause work in Datomic? -


i trying find latitudes fall between 2 inputs. query:

(defn- latlngs-within-new-bounds   [db w]   (d/q '[:find ?lat          :in $ ?a ?w          :where          [ ?e :location/lat ?lat]          [(>= ?lat ?a)]          (not           [(>= ?lat ?w)])]        db w)) 

my error:

3 unhandled com.google.common.util.concurrent.uncheckedexecutionexception    java.lang.runtimeexception: unable resolve symbol: ?lat in    context  2 caused clojure.lang.compiler$compilerexception  1 caused java.lang.runtimeexception    unable resolve symbol: ?lat in context                   util.java:  221  clojure.lang.util/runtimeexception 

any understanding what's wrong query appreciated. bonus points if can use datomic rules factor out in-bounds part of each half.

your code seems work me datomic-free 0.9.5173:

(defn- latlngs-within-new-bounds   [db w]   (d/q '[:find ?lat          :in $ ?a ?w          :where          [ ?e :location/lat ?lat]          [(>= ?lat ?a)]          (not            [(>= ?lat ?w)])]        db w))  (latlngs-within-new-bounds   [[1 :location/lat 1]    [2 :location/lat 2]    [3 :location/lat 3]    [4 :location/lat 4]    [4 :location/lat 5]]   2 4) => #{[2] [3]} 

Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -