From: Emmanuel Oga Date: 2008-08-16T05:00:00+09:00 Subject: Re: Ruby: Boolean Challenge > class OddRecognizer > def knows(num) > return self if num%2==0 > class << nil > def or(num) > return self if num%2==1 > return OddRecognizer.new > end > end > nil > end > > alias :or :knows > end Patrick: that sure works, the problem is that nil is extended with a or method that is not very intuitive for it... >> nil.or(2) => # what the 揃$%!$%!$%@!!!! Code pollution at is maximum expression hahaha I thought of doing something like that with false instead of nil, but is the same problem. And you can't dup nil true nor false obviously :) > It was an interesting question from a intellectual standpoint. > But I wouldn't touch this code with a ten foot pole. lol Hahaha I agree. -- Posted via http://www.ruby-forum.com/.