News for hackers. Stuff that matters.
Re:Ask Matz: why the id of nil is 4? by technomancy on Thursday February 02, 2012 @02:45PM (#3544154)
I found it very odd that he would place false before true, but then I realized that's probably just the C mindset leaking through.
Re:Ask Matz: why the id of nil is 4? by macournoyer on Thursday February 02, 2012 @03:54PM (#3544418)
Since in Ruby false and nil are the only "falsish" values and everything else is true, their values has been chosen to make a boolean test as efficient as possible. See: https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#...