From: Stefan Rusterholz Date: 2007-07-19T08:39:11+09:00 Subject: Re: overriding nil?, curiosity Matt Greer wrote: > Maybe this is a dumb question, but I'm gonna give it a shot. > > I was showing my friends how Ruby classes are always open and I did some > dumb things like redefine Integer#+ to always return 5, and such. But > trying > this: > > NilClass.class_eval do > def nil? > false > end > end > > result in this: > Taking a look at the code and I'm completely lost. Obviously Ruby itself > depends on a usable definition of nil? I'm sure it depends on some key > methods in String, Array etc to be defined as expected too. So I guess > there Nope, not ruby. IRB. Because IRB is written in ruby. Regards Stefan -- Posted via http://www.ruby-forum.com/.