From: Ryan Davis Date: 2012-08-28T05:05:12+09:00 Subject: Re: A Ruby class is never closed On Aug 27, 2012, at 02:25 , Robert Klemme wrote: > On Mon, Aug 27, 2012 at 10:58 AM, Ryan Davis wrote: >> >> On Aug 27, 2012, at 01:47 , Robert Klemme wrote: >> >>> On Sat, Aug 25, 2012 at 11:36 PM, Marc Heiler wrote: >>>> I think he basically wants to have a class that can never ever again be >>>> changed. >>>> >>>> As far as I know, this is not possible in ruby. >>> >>> In what ways can you still change a frozen class? >> >> class X; freeze; end >> X = X.dup > > The constant reassignment will prompt a warning. Oh come one. You know as well as I do how to avoid the warning. That's not the point. >> class X; def y; end; end # works fine > > You are not actually modifying the original class X. Instead you > create a copy and modify that. So what? How is that relevant? The thread is about how to make a locked down system that isn't trivially thwarted. Guess what... it was trivially thwarted. >> The people looking for these assurances have to be educated that it just isn't something that is worthwhile trying here. > > Well, at least particular measures help others recognize that it is a > bad idea what they are trying (i.e. doing the dup reassign trick you > present above can be done but will prompt a warning). Again. Not the point. You're being (intentionally?) obtuse... It doesn't matter how recognizable it is... if the OP wants a locked down system, ruby is NOT the place to attempt it.