This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-01
Channels
- # aleph (71)
- # aws (1)
- # bangalore-clj (4)
- # beginners (36)
- # boot (153)
- # cider (23)
- # clara (9)
- # cljs-dev (67)
- # cljsjs (2)
- # cljsrn (22)
- # clojure (348)
- # clojure-argentina (4)
- # clojure-austin (12)
- # clojure-berlin (9)
- # clojure-dusseldorf (6)
- # clojure-france (4)
- # clojure-italy (4)
- # clojure-russia (358)
- # clojure-spain (2)
- # clojure-spec (28)
- # clojure-uk (109)
- # clojurescript (130)
- # core-typed (1)
- # cursive (35)
- # datascript (6)
- # datomic (18)
- # emacs (12)
- # hoplon (4)
- # klipse (64)
- # lein-figwheel (13)
- # leiningen (3)
- # luminus (4)
- # lumo (51)
- # mount (22)
- # off-topic (83)
- # om (22)
- # om-next (8)
- # onyx (3)
- # pedestal (8)
- # perun (6)
- # portland-or (2)
- # re-frame (50)
- # ring (8)
- # ring-swagger (5)
- # untangled (10)
- # yada (9)
Reading the docs on keywords, it's mentioned that they are "interned" — does this make them closer in efficiency to a number rather than a string?
I think it refers to the fact that
(identical? (clojure.lang.Keyword/intern "a") (clojure.lang.Keyword/intern "a"))
Ah, I wasn't familiar with that terminology. So I guess the efficiency is more like a number than a string, neat
what’s a good way to store a value that only has one instance in the entire db? e.g. configuration or global values
do you mean something like this? https://support.cognitect.com/hc/en-us/articles/215581428-When-to-Use-Idents
In any case, we often have some entities which describe something about the database itself or reference other entities which are special in some way. A way to deal with this is to have a single well-known named entity in the db (named with an ident), and on it are attributes+values which assert those special things.
Datomic itself uses this technique for the :db.part/db partition (entity 0), where all the schema is held
@wei Yes, but it's better to have the ident remain unchanging than to move the ident to a different entity