[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Encapsulation, table-protection, and packages
- From: Mark Hamburg <mhamburg@...>
- Date: Thu, 06 Jan 2005 11:44:47 -0800
Not for table entries. The point is that I want to build an object out of a
table and I would like a way to confirm that only the code implementing the
object actually touches the internals.
It doesn't provide much that careful conventions don't, but it provides a
potentially nice way to support runtime checking. It's also potentially
important when running code you don't control.
One alternative way to get encapsulation would be to export all protected
objects as proxies leading to their implementations. That, however, makes
the code implementing the objects more complicated and seems like it might
require per-object metatables for the proxies.
on 1/6/05 10:55 AM, Roberto Ierusalimschy at firstname.lastname@example.org wrote:
>> Why would one want this? Primarily as a runtime check to confirm
> Isn't "local" enough for encapsulation?
> -- Roberto