clojure 2026-09-20

Following is a simplified version of destructuring found in fastmath.calculus.finite/extrapolate function.

(let [{:keys [^double init-h ^double rel]
       :or {init-h 0.5
            rel init-h}}
      {}]
  rel)
It fails with Clojure 1.13 :
1. Caused by java.lang.RuntimeException
   Unable to resolve symbol: init-h in this context
works in 1.12
(let [{:keys [^double init-h ^double rel]
       :or {init-h 0.5
            rel init-h}}
      {}]
  rel)
;;=> 0.5

(let [{:keys [^double init-h ^double rel]
       :or {init-h 0.5
            rel init-h}}
      {:init-h 0.7}]
  rel)
;;=> 0.7
Is a reference to another destructured key inside :or no longer valid? What's the reason for that?

Alex Miller (Clojure team) 2026-09-20T04:10:17.726459Z

:or maps should not use expressions based on other bindings created in the destructing form - the ordering of how things are bound is undefined

👍 2
Alex Miller (Clojure team) 2026-09-20T04:11:09.888019Z

That has always been true, it is just coming back to bite you now

> :or maps should not use expressions based on other bindings created in the destructing form - the ordering of how things are bound is undefined expressions based on other :or bindings or on any bindings anywhere in the form? Is this documented anywhere? I also can't tell from the docs if expressions besides literals are allowed as values in the :or map.

I believe it is a destructed binding, a destructed bringing doesn't define the order in which it binds the names, so you cannot depend on any of those being in place for any part of the destructuring

btw. all of this destructuring bugs are fixed already (and released) in fastmath 3.0.0-alpha9

Anyone else noticed https://clojure.github.io/core.cache/index.html -> jumped to core.cache 1.2.999-SNAPSHOT . Seems a little fishy. Do you know anything about it?

👀 1

Yeah, I think Fogus missed how the major.minor.commits versioning worked when he cut the latest release. He's talking about a 1.3.0 release next time and maybe switching to major.minor.patch versions. I'll take the blame for the confusion since I was the one who switched core.cache to major.minor.commits several releases ago 😐

✅ 1

1.2.999 is the actual release at this point.

I like major.minor.commits but it can be a PITA to make releases that way.

😂 1

Thanks for the clarification! I raised the question, because often poisoned packages will make such jumps etc. Just to make sure. Thanks @seancorfield!

True, I deal with this PITA and I get PTSD. Often.