clojure-dev

2024-02-15T13:25:35.808989Z

How does the core team balance defining “undefined behavior” (such as 1.11 map destructuring accepting a seq of a single map) with backwards compatibility and stability guarantees? Do y’all ever worry about repercussions from leaving behavior undefined (and then the unintended behavior gains widespread adoption), by forcing your hand to conform to existing behavior (even when unintentional)?

Alex Miller (Clojure team) 2024-02-15T13:28:36.654809Z

What is undefined in this case?

Alex Miller (Clojure team) 2024-02-15T13:30:50.218389Z

In this case we took something that was an error and made it do something useful. Generally we consider that to be an additive change and we do that all the time.

👍 1
Alex Miller (Clojure team) 2024-02-15T13:31:45.615329Z

Taking something that is undefined and making it defined as something new is another place to play but you have to worry about good old Hyrums Law

2024-02-15T13:32:10.918059Z

I mentioned the destructuring but maybe that one is not correct. As another example, clojure.set functions assume that their inputs are sets, and passing in other types is “undefined” (tho they have specific behavior that people might rely on).

2024-02-15T13:34:24.523919Z

Does that ever influence your decisions when it comes to defining or not defining behavior?

Alex Miller (Clojure team) 2024-02-15T13:54:31.732979Z

Of course