[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Proposal for Protected Types
- From: "Peter Hill" <corwin@...>
- Date: Fri, 21 Dec 2001 12:52:49 +0800
> The code you gave seems to work already. So why the proposal?
It works... but it does not protect the type against external tampering. Ie,
a piece of code can set any data to an arbitrary tag value (eg,
"settag(x,123)") which would then compromise the type's integrity.
Of course in practice, since an explicit "settag" is required, it is fairly
unlikely to happen accidently in a simple program.
Otoh, the opportunity exists here to implement *true abstract types* (ie,
ones that are externally seamless... completely hiding their internal
workings) by adding only a few lines of code and with almost no backward
compatibility problems.
And it also offers the opportunity to implement sensitive code in Lua
without compromising the host program's security.
*cheers*
Peter Hill