Fork me on GitHub
#clojure-dev
<
2022-12-11
>
mfikes21:12:39

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)21:12:51

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

borkdude21:12:11

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

borkdude21:12:33

oh duh, yes, that's kind of obvious

Alex Miller (Clojure team)21:12:41

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

Alex Miller (Clojure team)21:12:42

I would consider non integers to be undefined behavior

mfikes21:12:14

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

mfikes21:12:30

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.

mfikes21:12:29

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