Hacker News new | ask | show | jobs
by knutae 3215 days ago
For comparison, integers in clisp:

  [1]> (eq (expt 2 47) (expt 2 47))
  T
  [2]> (eq (expt 2 48) (expt 2 48))
  NIL
Explanation here: https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node17.html
1 comments

But nobody would use eq in lisp for this. For numbers you would use equal, comparing the values. You only would use eq for addresses, like cons cells or vectors. E.g. in php there is == vs ===.

re python: this is of course superlame. the compiler can easily detect "is <int>" and forbid the const int table optimization. Only "is None" would make sense.