Skip to content

Add support for clojure 1.11 / 1.12 core functions #1040

@yuhan0

Description

@yuhan0

Is your feature request related to a problem? Please describe.
Several core functions newly added in Clojure 1.11 and 1.12 are not available in SCI:

(-> (ns-publics 'clojure.core)
    (->> (group-by (comp :added meta val)))
    (select-keys ["1.11" "1.12"])
    (update-vals #(mapv key %)))
; =>
{"1.11" [abs NaN? infinite?
         random-uuid
         parse-boolean parse-double parse-long parse-uuid
         update-keys update-vals
         iteration
         seq-to-map-for-destructuring]
 "1.12" [partitionv partitionv-all splitv-at
         stream-into! stream-reduce! stream-seq! stream-transduce!
         *repl*]}

I encountered this while testing out the SCI-backed macroexpansion feature in clj-kondo, in particular missing the parse-long and partitionv core functions.

Describe the solution you'd like

Apart from the stream-* functions (JVM-specific and out-of-scope), the remaining ones all look like useful candidates for inclusion, I believe it's a matter of registering them via copy-core-var in sci.impl.namespaces? Not sure if / how the semantics of *repl* should be handled.

Note that seq-to-map-for-destructuring is already present with a polyfilled impl and random-uuid is already present in a cljs branch.

Describe alternatives you've considered

It's not clear if SCI explicitly targets a minimum Clojure version - If the app depends on an older version, I think copy-core-var on a non-existent var would be a load-time error. There is existing version-gating machinery in place, should be straightforward to extend to >=1.11.0, >=1.12.0 etc to conditionally register them.

Additional context
2025 State of Clojure survey results:
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions