From 9507423c23242c4ef0783f17c4d7d5cf0afad858 Mon Sep 17 00:00:00 2001 From: davidnolen Date: Tue, 25 Nov 2025 06:01:26 -0500 Subject: [PATCH] be less specific around int coercion fns --- src/main/cljs/cljs/core.cljs | 8 ++++---- src/main/clojure/cljs/core.cljc | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/cljs/cljs/core.cljs b/src/main/cljs/cljs/core.cljs index ad87e9505..40944f0c8 100644 --- a/src/main/cljs/cljs/core.cljs +++ b/src/main/cljs/cljs/core.cljs @@ -2932,22 +2932,22 @@ reduces them without incurring seq initialization" (Math/ceil q))) (defn int - "Coerce to int by stripping decimal places." + "Coerce to int." [x] (bit-or x 0)) (defn unchecked-int - "Coerce to int by stripping decimal places." + "Coerce to int." [x] (fix x)) (defn long - "Coerce to long by stripping decimal places. Identical to `int'." + "Coerce to long. Identical to `int'." [x] (fix x)) (defn unchecked-long - "Coerce to long by stripping decimal places. Identical to `int'." + "Coerce to long. Identical to `int'." [x] (fix x)) diff --git a/src/main/clojure/cljs/core.cljc b/src/main/clojure/cljs/core.cljc index f6cfb7a1e..adde92ad0 100644 --- a/src/main/clojure/cljs/core.cljc +++ b/src/main/clojure/cljs/core.cljc @@ -1236,8 +1236,9 @@ ([x y] (core/list 'js* "(~{} | ~{})" x y)) ([x y & more] `(bit-or (bit-or ~x ~y) ~@more))) -(core/defmacro ^::ana/numeric int [x] - `(bit-or ~x 0)) +(core/defmacro int + [x] + (core/list 'js* "(~{} | 0)" x)) (core/defmacro ^::ana/numeric bit-xor ([x y] (core/list 'js* "(~{} ^ ~{})" x y))