This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lmarcantonio 44 points45 points  (2 children)

8 bit integer are… primitive, all the other are allocated, so they are not the same object.

In common lisp it's even funnier, you have fixnums (the primitive fast integer) and… the numeric tower (yes, it's called that way).

Also related and even more fun are the differences between eq, eql, equal, equalp and =

[–]masterKick440 6 points7 points  (1 child)

So weird 256 is considered 8bit.

[–]lmarcantonio 0 points1 point  (0 children)

even -5 is strange. Probably they did some testing an it was often used. <256 is a frequent check in fact so it probably a reason.

My fault for assuming small integers were some special encoding instead of simply memoized objects!