From: Stefan Rusterholz Date: 2007-02-18T00:33:25+09:00 Subject: Re: Oppinions on RCR for dup on immutable classes unknown wrote: > because, in ruby, all methods can be changed all the time: > > class C > def dup() raise "now you can't" end > end > > c = C.new > > c.dup rescue nil > > class << c > def dup() raise "now you can" end > end > > c.dup > > just because an object responded to a message one time, at compile time, > or > whatever - doesn't mean it will later. this is the dynamic in 'dynamic > languages.' > > note that being able to dump singleton classes doesn't change this one > bit. > > regards. > > > -a Care to explain why you chose defining a method with the sole purpose of raising an exception over removing the method instead? My regards -- Posted via http://www.ruby-forum.com/.