clojure-dev

borkdude 2024-02-12T19:00:34.867849Z

Has a spec for extend-protocol etc ever been considered?

user=> (s/get-spec `extend-protocol)
nil
Mostly interested in stating that the class names must be simple symbols (rather than Class/forName expression, which can go bad: https://clojure.atlassian.net/browse/CLJ-1381) It seems in Clojure 1.12 there's no longer the need to write Class/forName for primitive arrays since we can write byte* etc

borkdude 2024-02-13T10:04:30.034099Z

No interest I guess then

hifumi123 2024-02-14T02:32:45.202849Z

Hm… a quick search on Ask Clojure suggests the answer to your question is a solid “no”. > We do not plan to add specs for the functions in core. cf. https://ask.clojure.org/index.php/12851/full-specs-for-clojure-core-in-core-specs-alpha?show=12855#a12855

2024-02-14T04:24:18.398309Z

i don't think that's quite accurate, extend-protocol is a macro and there are plenty of specs for clojure.core macros

👍 1
borkdude 2024-02-14T13:26:20.219369Z

Perhaps @alexmiller just didn't catch this message

Alex Miller (Clojure team) 2024-02-14T13:54:20.485729Z

Put it on ask

cfleming 2024-02-12T22:35:36.983039Z

Am I correct in thinking that the new Class/member syntax can’t be used to refer to fields?

cfleming 2024-02-12T22:39:02.515329Z

Previously it could be used for static fields.

Alex Miller (Clojure team) 2024-02-12T22:39:13.344989Z

still is for static fields

Alex Miller (Clojure team) 2024-02-12T22:39:34.644319Z

no change here

cfleming 2024-02-12T22:40:29.099259Z

Ok, but my question is really whether there are changes to allow MyClass/instanceField - I’m assuming not, but was just clarifying.

Alex Miller (Clojure team) 2024-02-12T22:40:52.092299Z

no

cfleming 2024-02-12T22:40:59.629399Z

Thanks.

2024-02-16T15:29:46.142199Z

it should be Class/method syntax. If we said Class/member somewhere please point that out

Alex Miller (Clojure team) 2024-02-16T18:59:53.143549Z

The ticket title said that, I’ve updated

👍 1