_Comment made by: favila_
What should be the goal for the various numeric predicates in CLJS?
Is the goal to align with CLJ's meaning of these predicates? If so then:
{{number?}} true for typeof-number or goog.math.Integer or goog.math.Long
{{integer?}} true for goog.math.isInt/Number.isInteger or goog.math.Integer or goog.math.Long
{{int?}} true for goog.math.isInt/Number.isInteger or goog.math.Long
Is the goal to align with some notion of platform-primitiveness? If so then:
{{number?}} true for typeof-number or goog.math.Integer or goog.math.Long
{{integer?}} true for goog.math.isInt/Number.isInteger or goog.math.Integer or goog.math.Long
{{int?}} true for goog.math.isInt only
Is the goal to be a can-I-do-arithmetic-with-this type check? If so then:
{{number?}} true for typeof-number only
{{integer?}} true for goog.math.isInt (or maybe even Number.isSafeInteger)
{{int?}} same as integer?
In Java/CLJ these three goals are much more aligned with one another. Any number-as-identifier can also be used for clj arithmetic (so the widest check, {{number?}}, can also be used for arithmetic checking), and {{int?}} corresponds exactly to the host's most-primitive integer value-types (vs object-type).
CLJS lacks a number tower so it's more interesting.
Right now in CLJS {{number?}} appears to be designed as a predicate to test for whether arithmetic is possible, so it only allows js type-of===number. {{integer?}} is also an arithmetic check, but wants a non-fractional number (interestingly, still allowing unsafe integers, i.e. outside Number.MAX_SAFE_INTEGER, where normal integer arithmetic doesn't work--perhaps it should only allow safe integers). {{int?}} doesn't care about arithmetic, but it's still useful for seeing if a value could be a numeric identifier (e.g. a record id received via transit); but that's expressly *not* what CLJ's int? cares about.