This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-01
Channels
- # aleph (2)
- # beginners (137)
- # boot (4)
- # cider (10)
- # clara (29)
- # cljs-dev (71)
- # cljsrn (7)
- # clojure (105)
- # clojure-bangladesh (1)
- # clojure-france (2)
- # clojure-italy (4)
- # clojure-nl (3)
- # clojure-russia (1)
- # clojure-spec (30)
- # clojure-sweden (5)
- # clojure-uk (71)
- # clojurescript (217)
- # cursive (36)
- # data-science (1)
- # datomic (11)
- # duct (53)
- # fulcro (2)
- # garden (3)
- # jobs (1)
- # lein-figwheel (23)
- # luminus (3)
- # lumo (7)
- # mount (13)
- # off-topic (88)
- # pedestal (3)
- # re-frame (63)
- # reagent (85)
- # remote-jobs (1)
- # ring-swagger (3)
- # shadow-cljs (81)
- # spacemacs (5)
- # tools-deps (16)
- # yada (2)
can I pass _
as an argument to d/q
? to avoid explicitly implementing extra arity in cases like:
(defn f
;; what I want to write:
([db a] (f db a '_))
;; what I have to write:
([db a] (d/q '[:find [e?...] :in $ ?a ?v :where [?e ?a]] db a))
([db a v] (d/q '[:find [e?...] :in $ ?a ?v :where [?e ?a ?v]] db a v)))
(defn f
[db & args]
(let [[_ & syms
:as frags] (into '[?e] (for [i args
:when (not (nil? i))]
(gensym "?arg-")))
query (into '[:find [?e ...] :in] (concat syms [:where]))]
(apply vector (conj query frags) db args)))
no the actual query I need it for is not that much larger than the one in example, and I choose readability over the spell you suggested, @U2J4FRT2T however, thank you : )
I know that pull
can accept "*"
as a string, but neither "_"
nor '_
seem to work here ^^^
is :db.install/valueType
"exposed" to datomic users? Did anyone try install any composite types yet? can't seem google anything related
@misha what are you trying to do?
@U064X3EF3 I think I am asking exactly that.
@U09K620SG the use case is usual – to put something in db without forgetting to pr-str
read-string
. But in this particular case, I just stumbled upon it and wanted to explore.
yeah, datomic attribute types are fixed (for now at least). Clojure certainly makes it possible to consider extensible types at a future point though.
It’s not extensible if that’s what you’re asking
@misha what are you trying to do?
I think you have to use query to get to the transaction component and its attributes