[cap-talk] __equalizer and such E operations (was: EQ, MyCap? review)
Kevin Reid
kpreid at mac.com
Tue Feb 12 19:27:17 EST 2008
On Feb 12, 2008, at 18:54, Jed Donnelley wrote:
> It seems from the above that the operation of __equalizer could not
> itself be programmed in E.
The equalizer's algorithm could be written in E, but it would still
need a lower-level primitive; a quick review suggests that the only
primitive required is pointer comparison (and __auditedBy, but that's
itself widely available in the safeScope).
> It provides information that could not otherwise be obtained
> about objects. Can you give us an idea of how many such objects or
> other primitives there are
> that relate to the base domain protection in E?
I'm not sure what primitives you would consider to 'relate to the
base domain protection', but the list that comes to mind is:
__equalizer (as above)
__auditedBy (tests whether an object has been approved by a
particular auditor; this may be analogous to the "MyCap?" being
discussed)
> in particular when you said 'the latter may invoke the code of the
> object'. What sort of object property could induce __equalizer to
> invoke "the" object?
Selfless; the auditor-granted property that its creation-identity is
invisible and it is compared by structure instead. Both objects in
the comparison are invoked (__optUncall/0) to request their self-
descriptions for traversal.
Selfless objects are all immutable (but not transitively).
> By "the" object, I assume you mean the first of the two objects -
> or is it
> more complex than that?
If both objects are Selfless, both are invoked, and the resulting
lists compared recursively; otherwise, neither is.
> Can you tell us:
>
> 1. How E decides whether to compare two objects structurally or as
> pointers? If E chooses to compare two object structurally then I
> assume this is because in some circumstances they may be regarded
> as EQ even though their pointers aren't the same? Can you motivate
> this choice?
I hope the above answers these questions.
> 2. When you say that "pointer comparisons on objects which
> __equalizer compares structurally are prohibited", how would a
> desire to make such a pointer comparison even be expressed?
For example, if a 'safe' finalizer-installing operation is provided,
it would allow for a sort of pointer comparison, in that one could
notice the difference (or lack thereof) in time-of-finalization.
Therefore, such an operation must only allow finalizers to be
installed on non-Selfless objects. Similar considerations apply to
weak hash tables.
--
Kevin Reid <http://homepage.mac.com/kpreid/>
More information about the cap-talk
mailing list