On Wed, Feb 27, 2008 at 7:12 AM, Joel VanderWerf
<vjoel / path.berkeley.edu> wrote:
> Robert Dober wrote:
>  > On Tue, Feb 26, 2008 at 4:52 PM, James Gray <james / grayproductions.net> wrote:
>  >> On Feb 26, 2008, at 9:45 AM, Jones, Brian - McClatchy Interactive wrote:
>  >>
>  >>  > I'd be at least a little interested in potentially offering developers
>  >>  > the chance to 'lock' their classes from monkey patches.
>  >>
>  >>  There are probably ways around this, but:
>  > Hmm I do not think that one can overrule freeze; I never found  a way,
>  > anyone else?
>  > Cheers
>  > Robert
>
>  You can monkeypatch Class#freeze, as long as you get there first ;)
>
>  class Class
>    def freeze; end
>  end
>
>  class Foo
>    def bar; end
>  end
>
>  Foo.freeze
>
>  class Foo
>    def zap; end
>  end
>
>
>
>
>  --
>        vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
>
>

That indeed is a truly perverse use case for MP, you have my deepest respect ;).
It is indeed an extreme example what the enabling approach can lead
to, but it is maybe not a coincidence that it was Smalltalk which
really brought up UT first IIRC?
That is something we should add into this discussion, MP might be a
danger for Ruby to be extincted (I do not believe so but just for the
sake of argument), TDD (or BDD) might save it somehow.
But there is no doubt it is not much of a relief if somebody released
something stupid in a library and now a zillion tests do not pass
anymore.

Just out of curiosity why does Class#freeze need to exist and cannot
be inherited from Object#freeze?

Cheers
Robert

-- 
http://ruby-smalltalk.blogspot.com/

---
Whereof one cannot speak, thereof one must be silent.
Ludwig Wittgenstein