clojure-dev

seancorfield 2024-01-12T18:43:01.200759Z

> we’ve switched back from String- to String syntax for class array literals I'm curious about the decision matrix behind this change...

vlaaad 2024-01-12T18:46:21.875469Z

Not curious, thank God!

➕ 3
seancorfield 2024-01-12T18:55:31.832379Z

If you're not interested in the topic, there's no need to make a comment -- especially a snarky one like this.

vlaaad 2024-01-12T18:57:26.134029Z

Sorry, I shouldn't have been that snarky. In my opinion, the previous naming convention was ugly.

Alex Miller (Clojure team) 2024-01-12T18:57:38.535329Z

in essence, the slightly increased overlap with existing cases was deemed to be less of an issue than not liking the "-"

seancorfield 2024-01-12T18:58:05.860129Z

Thanks, @alexmiller

seancorfield 2024-01-12T18:58:57.763519Z

Is String* "just" syntax or will it exist as a symbol in clojure.core?

Alex Miller (Clojure team) 2024-01-12T18:59:06.518639Z

syntax

Alex Miller (Clojure team) 2024-01-12T18:59:33.115809Z

we couldn't add array class symbol mappings for all classes in the universe so....

seancorfield 2024-01-12T18:59:47.832999Z

OK, so if there is a "conflict" with a namespace symbol that matches, you can't use the syntax without renaming your namespace symbol?

Alex Miller (Clojure team) 2024-01-12T19:00:04.286549Z

correct (or you can do what you do now)

seancorfield 2024-01-12T19:00:18.252299Z

Got it. Thanks.

Alex Miller (Clojure team) 2024-01-12T19:00:29.712509Z

that universe of overlap was deemed to be small enough

Alex Miller (Clojure team) 2024-01-12T19:02:12.680579Z

note that there is no conflict for use as type hints, this is only an issue when resolving a class array symbol as a value

👍🏻 1
Alex Miller (Clojure team) 2024-01-12T19:02:30.905259Z

so you can always use it as a type hint

👍🏻 1
seancorfield 2024-01-12T19:05:05.377719Z

Looking forward to trying it out in Alpha 6 🙂

Alex Miller (Clojure team) 2024-01-12T19:10:56.878479Z

looking forward to having an alpha 6 :)

😅 1
2024-01-12T20:53:59.798339Z

> note that there is no conflict for use as type hints, this is only an issue when resolving a class array symbol as a value what would be an example of doing this?

Alex Miller (Clojure team) 2024-01-12T21:12:03.776229Z

doing which - type hint or value?

seancorfield 2024-01-12T21:12:47.990759Z

> only an issue when resolving a class array symbol as a value I assume "as a value"...

Alex Miller (Clojure team) 2024-01-12T21:13:11.946879Z

same as any case where you would currently use a ClassName as a value

Alex Miller (Clojure team) 2024-01-12T21:13:57.071799Z

using as an instance? check, extending as a protocol, switching a multimethod, etc

seancorfield 2024-01-12T21:14:18.192799Z

into-array potentially too?

Alex Miller (Clojure team) 2024-01-12T21:15:51.521009Z

seems unlikely, but sure

2024-01-12T21:21:25.080899Z

Ah ok. I see now.

Alex Miller (Clojure team) 2024-01-12T19:15:11.788779Z

if anyone is interested, I have been working on doc updates for Clojure 1.12 in a site branch https://github.com/clojure/clojure-site/compare/master...1.12-doc-updates#files_bucket - this has not been reviewed yet but should be mostly up to date

👍 4
borkdude 2024-01-13T10:59:47.587719Z

The new syntax is great for auto-completion by static analysis (kondo+lsp). It (imo) begs the question if class aliases would become desirable since class names are going to be repeated a lot with this new syntax. E.g.:

(ns foo (:import [java.io.File :as F]))
(F/exists "README.md")

Alex Miller (Clojure team) 2024-01-13T12:22:41.895819Z

Not doing that

borkdude 2024-01-13T12:24:06.565479Z

well ok, even less work for static analysis then, thanks ;)

Alex Miller (Clojure team) 2024-01-12T19:16:20.932569Z

functional interface coercion is still a TODO

2024-01-12T19:26:10.854319Z

these are good changes, thanks for the link

seancorfield 2024-01-12T19:27:42.677399Z

> These functions are available in the tools.deps.repl namespace: That should be clojure.repl.deps (line 169 of repl_and_main.adoc).

👍 1
seancorfield 2024-01-12T19:31:24.693709Z

Where this block was updated, the last two items were removed -- is that because (Classname/method args*) is "core" syntax now and not expanded to a . form (and covers both static and instance method invocation)?

(.instanceMember instance args*) ==> (. instance instanceMember args*)
(.instanceMember Classname args*) ==> (. (identity Classname) instanceMember args*)
(.-instanceField instance) ==> (. instance -instanceField)
(Classname/staticMethod args*) ==> (. Classname staticMethod args*) ; removed
Classname/staticField ==> (. Classname staticField) ; removed

Alex Miller (Clojure team) 2024-01-12T19:34:21.754429Z

the last one was removed because it is a lie - that has never happened :)

😂 2
Alex Miller (Clojure team) 2024-01-12T19:34:58.671619Z

and the 2nd to last has been removed because that is part of the implementation - we are going to stop macroexpanding the Class/member to dot form

👍🏻 1
Alex Miller (Clojure team) 2024-01-12T19:36:36.387889Z

the dot form still exists, will still work, etc but we're going to instead understand Class/method directly in the compiler now. in function position this will ultimately create the identical expressions it creates now but the path will be a bit different. in value position, this will create a new expression that emits as a thunk.

Alex Miller (Clojure team) 2024-01-12T19:37:44.924019Z

lots of implementation choices in this area

seancorfield 2024-01-12T19:38:07.560929Z

Nice simplification (for us users, not so much for you implementors!).

Alex Miller (Clojure team) 2024-01-12T19:39:05.159739Z

it actually is much simpler than what we were doing in the implementation too

Alex Miller (Clojure team) 2024-01-12T19:40:19.099159Z

macroexpansion will do less so we're removing code there, and we no longer need anything in syntax quote resolution, and we get rid of all the symbol string parsing

👍 1
👍🏻 1
😮 1
Alex Miller (Clojure team) 2024-01-12T19:40:49.965769Z

the analyzer is the only tricky bit