clojure-dev 2022-12-11

Wondering if this behavior change is considered a bug, undesired, or irrelevant:

Clojure 1.11.1
user=> (drop 1.5 [1 2 3])
(3)
user=> (drop 1.5 (seq "abc"))
(\c)
vs.
Clojure 1.12.0-alpha1
user=> (drop 1.5 [1 2 3])
(2 3)
user=> (drop 1.5 (seq "abc"))
(\b \c)

Alex Miller (Clojure team) 2022-12-11T21:18:51.198439Z

That seems to be a different discussion. Range supports all number types.

What's the use case for non-int in range again?

Alex Miller (Clojure team) 2022-12-11T21:20:02.477409Z

Ranges of non ints?

oh duh, yes, that's kind of obvious

Alex Miller (Clojure team) 2022-12-11T21:20:41.074969Z

Range makes a series of numbers from start number to end number, stepping by numbers

Alex Miller (Clojure team) 2022-12-11T21:16:42.280669Z

I would consider non integers to be undefined behavior

It would also seem that if you tried to define the behavior you might go down an intractable rat hole.

I was messing with porting this (`IDrop`) to ClojureScript and that WIP implementation definitely exhibits undefined behavior.

cljs.user=> (drop 1.5 (seq "abc"))
(nil nil)
There have been cases in the past where these sorts of things have been pushed to have ClojureScript match Clojure, where reasonable, perf-wise.

Cool. I won't report a bug against 1.12.0-alpha1.