From: Michal Rokos Date: 2002-02-23T15:41:03+09:00 Subject: Re: dispatching and class references Alexander Schofield wrote: > It does, but there's also an issue here about where does it end that all > languages face. Like what about protecting an object from its class?: > irb(main):001:0> class C > irb(main):002:1> end > nil > irb(main):003:0> c = C.new > # > irb(main):004:0> c.freeze > # > irb(main):005:0> class C > irb(main):006:1> def m > irb(main):007:2> puts 'boo!' > irb(main):008:2> end > irb(main):009:1> end > nil > irb(main):010:0> c.m > boo! > nil You can do this, if you set appropriates $SAFE level. > > Object is a class, the ancestor of everything. You can have a > #deep_freeze method, but its behavior will always leave a large portion > of people complaining that it's counter-intuitive, or it should do X > instead of Y... > Should 'standard' freeze method behave like deep_freeze? > Paul Brannan wrote: >> >> On Sat, Feb 23, 2002 at 07:00:33AM +0900, Michal Rokos wrote: >> > Do we need deep_freeze? >> >> Sounds like something out of a bad movie :) >> >> Paul Paul: Do you think that there is no need for method like "deep_freeze"? (I don't care about name - you know what it should do.) Michal -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Michal Rokos Czech Technical University, Prague E-mail: m.rokos@sh.cvut.cz Jabber: majkl@jabber.cz, ICQ: 36118339 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-