From: Christoph Date: 2002-02-20T08:17:59+09:00 Subject: Re: FalseClass / TrueClass singleton methods? "Paul Brannan" wrote in .... > This is not entirely true... > > class << TrueClass > remove_method :new > end > > p TrueClass.new > > but, of course, you should not do this :) Interesting - in cvs that would be ---- class << TrueClass remove_method :new remove_method :allocate end # The resulting pauls_truth = TrueClass.new # works as expected - however neither works for FalseClass nor NilClass # - i.e. the barbwires of reintroducing new (and assuming cvs) allocate are higher class << NilClass def new; end def allocate; end remove_method :new remove_method :allocate def new; super end def allocate; super end end # and the resulting christophs_nil = NilClass.new # unfortunately (but not unexpectedly) does not quite work (as expected) - e.g. p christophs_nil | nil # => false - which is wrong, however p nil | christophs_nil # => true p christophs_nil.nil? # => true ---- /Christoph