[E-Lang] Rights Amplification: The Next Layer Up
Mark S. Miller
markm@caplet.com
Wed, 06 Sep 2000 10:53:36 -0700
At 11:51 PM 9/5/00 , Dean Tribble wrote:
>At 05:30 PM 9/5/2000, Mark S. Miller wrote:
>> New Universal Method: getOptSealedFacet(brand)
>How about getOptMeta? "Sealed" is just an implementation issue; the purpose is to get meta-level access. It is also not necessarily a facet, for example in the comm case, it returns a replacement object, which is probably not a facet.
Agreed. Done.
>>We define one new universal method. When written without sugar, a method ...
>> match ==(FooSealer brand) {
>
>Is this really what "match" looks like?
The match syntax is
match pattern { expr }
The sugared pattern for equality testing is
==expr
which expands to
x ? x == expr
>> Uses
>>
>>...to return an object to be serialized in lieu of itself. The replaceObject()
>>method of a given serialization stream may do:
>>
>> to replaceObject(original) :any {
>> def optBox := original getOptSealedFacet(myUnsealer brand)
>> if (optBox == null) {
>> original
>> } else {
>> myUnsealer unseal(optBox)
>> }
>
>Should this be?
>
> } else {
> def rep := myUnsealer unseal(optBox)
> if (rep == original) {
> rep
> } else {
> replaceObject(rep)
> }
> }
I believe Java Serialization will do this for me, whether I like it or not,
as long as I provide any replacement at all for the original object. If I
misunderstood, then, yes, the code should be as you wrote.
Cheers,
--MarkM