[cap-talk] EQ, MyCap? review (was: Toby's Confused deputy statement)
Mark Miller
erights at gmail.com
Mon Feb 11 19:37:42 EST 2008
On Feb 11, 2008 3:45 PM, Jed Donnelley <jed at nersc.gov> wrote:
> In E, for example, the "MyCap?" notion appears
> implicitly in private references. Consider this
> implementation of makeBrandPair:
> _________
> # E sample
> def makeBrandPair(nickname) {
> def noObject{}
> var shared := noObject
> def makeSealedBox(obj) {
> def box {
> to shareContent() {shared := obj}
> }
> return box
> }
> def sealer {
> to seal(obj) {return makeSealedBox(obj)}
> }
> def unsealer {
> to unseal(box) {
> shared := noObject
> box.shareContent()
> if (shared == noObject) {throw("invalid box")}
> def contents := shared
> shared := noObject
> return contents
> }
> }
> return [sealer, unsealer]
> }
> ______
>
> I think the essence of MyCap? is there in the
> box.shareContent() operation which will only
> set the "shared" variable if (I assume) the
> private "shareContent" operation is available
> on the "box" parameter that was sent in to the
> unsealer.
I don't understand what this is saying, so I can't tell whether it is
accurate or not. Can you expand? Thanks.
--
Text by me above is hereby placed in the public domain
Cheers,
--MarkM
More information about the cap-talk
mailing list