This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-11-25
Channels
- # architecture (12)
- # asami (6)
- # aws (2)
- # babashka (2)
- # beginners (71)
- # bristol-clojurians (1)
- # calva (1)
- # cider (2)
- # clojure (136)
- # clojure-australia (6)
- # clojure-dev (14)
- # clojure-europe (11)
- # clojure-italy (3)
- # clojure-nl (2)
- # clojure-sanfrancisco (29)
- # clojure-uk (9)
- # clojuredesign-podcast (12)
- # clojurescript (23)
- # code-reviews (7)
- # core-logic (5)
- # cryogen (7)
- # datomic (7)
- # depstar (7)
- # events (3)
- # fulcro (11)
- # helix (1)
- # jobs (2)
- # juxt (4)
- # kaocha (25)
- # leiningen (2)
- # malli (11)
- # off-topic (8)
- # pathom (1)
- # pedestal (9)
- # portkey (1)
- # reitit (3)
- # ring (2)
- # sci (46)
- # shadow-cljs (21)
- # tools-deps (15)
- # xtdb (31)
it allows them, but not as fields, only as keys
(ins)user=> (defrecord Foo [a b])
user.Foo
(ins)user=> (-> (->Foo 1 2) (assoc :bar/baz 'x))
#user.Foo{:a 1, :b 2, :bar/baz x}
but I'm sure that's what you meantQuestion regarding :inline
meta and definline
I recall reading Alex's comment in one Reddit discussion where he mentioned inlining should not be used or relied upon, and should be considered experimental.
• Why? It's been around forever by now. Has any feature been deprecated after so long?
• Are there some plans for the future of inlining?
The docstring for it has said it is experimental since it was added, the experiment may end
I don't know anything about plans, but rich has fiddled with a number of different "optimized linking" approaches over the years, which you could sort of kind of categorize definline with
Static linking is, I think, completely disabled in the compiler, but the annotations for it are still in core.clj
And this is all stuff at the clojure compiler level, which outputs jvm byte code, which then the jit compiles
The jit is where all the real inlining happens, the clojure compiler just tries make its job easier
Rich does have some ideas on an alternative to definline but it has never risen up to a high enough priority to explore it