Subject line says it all: nil.id #=> 4 !!!

$ ruby -v
ruby 1.8.1 (2003-12-25) [powerpc-darwin]
$ ruby -e "puts nil.id; puts false.id; puts true.id"
4
0
2

This showed up as a bug in my code when finding records against nil 
*GOT RESULTS*. I'll need to override NilClass#id.  :-/

I can certainly understand rationales for nil.respond_to?(:id) -- 
everything's an object, etc., etc. But I also might suggest that the id 
of nil shouldn't be 4?! Shouldn't nil be able to be used as a 
lightweight and/or primitive Null Object?

-- 
Ryan "John" Platte
Custom services, NIKA Consulting
http://nikaconsulting.com/