jank icon indicating copy to clipboard operation
jank copied to clipboard

Numeric operators misbehave when in unary position

Open shantanu-sardesai opened this issue 1 month ago • 1 comments

When we use +, *, etc. (including the promotion operators) jank doesn't make sure that the passed in values are actually numeric.

user=> (* :k)
:k

While Clojure attempts to cast the passed in value to a java.lang.Number.

user=> (* :k)
Execution error (ClassCastException) at java.lang.Class/cast (Class.java:3492).
Cannot cast clojure.lang.Keyword to java.lang.Number

shantanu-sardesai avatar Nov 25 '25 09:11 shantanu-sardesai