Is this expected?
cljs.user=> (apply inc [2 17])
3
cljs.user=> (inc 2 17)
Unexpected error (ArityException) compiling at (<cljs repl>:1:1).
Wrong number of args (2) passed to: cljs.core/inc
Seems like apply should throw an exception when the number of parameters doesn’t match the function signature. This can also cause issues with partial since it uses apply under the hood.This is because inc is both a macro and function. The macro version is ran inside the JVM and yields more optimal code
To add to that - it is indeed known and expected. In general, neither Clojure nor ClojureScript check argument types and amount. It's just that on JVM, the argument amount is enforced by the JVM.
Ah, OK. Understood.