Fork me on GitHub
#clojure-dev
<
2020-11-25
>
devn04:11:39

Ever possible that defrecord would support namespaced keys? I hope the answer is no.

noisesmith16:11:13

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 meant

dominicm06:11:52

@devn I think it's been raised as an idea before.

Ben Sless08:11:03

Question 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?

hiredman09:11:36

The docstring for it has said it is experimental since it was added, the experiment may end

Ben Sless09:11:26

That's for definline, I don't recall seeing that mentioned for inline meta

3
hiredman09:11:53

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

hiredman09:11:02

definline, const, static, and direct

hiredman09:11:41

const is basically definline for values instead of functions

hiredman09:11:31

Static linking is, I think, completely disabled in the compiler, but the annotations for it are still in core.clj

hiredman09:11:03

Direct linking is the replacement for static linking

hiredman09:11:09

And this is all stuff at the clojure compiler level, which outputs jvm byte code, which then the jit compiles

hiredman09:11:12

The jit is where all the real inlining happens, the clojure compiler just tries make its job easier

Alex Miller (Clojure team)14:11:06

Rich does have some ideas on an alternative to definline but it has never risen up to a high enough priority to explore it