There’s an article The Ruby VALUE on O’Reillynet today. It shows a rather neat hack whereby ruby uses a few bits of an integer to specify extra information, like whether the value is
nil or not.
It does mean that FixNums only go up to 230 instead of 232, but that’s not a serious limitation, because it transparently turns them into BigNums instead.
Note that Lisp is unlike many other languages in that Lisp objects are self-typing: the primitive type of the object is implicit in the object itself. For example, if an object is a vector, nothing can treat it as a number; Lisp knows it is a vector, not a number.
But it’s not only Emacs, lisps in general have a history of doing this. This leads to the lovely notion that the data has a type as opposed to the variable, which seems to confuse C programmers so much. 🙂