From: Patrick Li Date: 2008-08-16T04:24:14+09:00 Subject: Re: Ruby: Boolean Challenge Hey, Sorry for the late reply: I was out to lunch: I didn't know you can't instantiate NilClass. Anyway here's a workaround involving singletons: class OddRecognizer def knows(num) return self if num%2==0 o = nil class << o def or(num) return self if num%2==1 return OddRecognizer.new end end return o end alias :or :knows end It was an interesting question from a intellectual standpoint. But I wouldn't touch this code with a ten foot pole. lol -Patrick -- Posted via http://www.ruby-forum.com/.