Forum: Ruby Re: final/closed classes in Ruby (was: Sharp knives and glue

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Berger, Daniel (Guest)
on 2006-05-11 23:59
(Received via mailing list)
> -----Original Message-----
> From: Tanner Burson [mailto:tanner.burson@gmail.com]
> Sent: Thursday, May 11, 2006 3:50 PM
> To: ruby-talk ML
> Subject: Re: final/closed classes in Ruby (was: Sharp knives and glue)

<snip>

> But any solution you can put into place with pure ruby, can
> be circumvented just as easily. :)

True, but if someone goes out of their way to circumvent your protection
mechanisms, the egg is entirely on their face if something goes wrong as
a result.  I consider things like private, protected, etc, to be
advisory, not absolute.  You break it, you bought it, and all that.

You can circumvent such constructs in other languages as well.  Consider
'#define private public'. >:)

Regards,

Dan


This communication is the property of Qwest and may contain confidential
or
privileged information. Unauthorized use of this communication is
strictly
prohibited and may be unlawful.  If you have received this communication
in error, please immediately notify the sender by reply e-mail and
destroy
all copies of the communication and any attachments.
Jake McArthur (Guest)
on 2006-05-12 00:08
(Received via mailing list)
On May 11, 2006, at 4:58 PM, Berger, Daniel wrote:

> '#define private public'. >:)

Arguably, that is not C but a preprocessor macro. The same thing
could be done by including Ruby code and preprocessing using a Ruby
script (interesting...).
Christian Neukirchen (Guest)
on 2006-05-12 13:19
(Received via mailing list)
"Berger, Daniel" <Daniel.Berger@qwest.com> writes:

> You can circumvent such constructs in other languages as well.  Consider
> '#define private public'. >:)

IIRC, they found that in early OpenOffice header files. ;-)
This topic is locked and can not be replied to.