[e-lang] "implements Selfless" is useful!

Kevin Reid kpreid at mac.com
Sat Sep 15 19:09:07 EDT 2007


On Sep 15, 2007, at 16:33, Mark Miller wrote:
> On 9/15/07, Kevin Reid <kpreid at mac.com> wrote:
>> [...] and what should happen when an object does "implements  
>> Selfless" but not also Transparent (or any other supported means  
>> of comparison). We decided that such an object should be  
>> considered permanently *unsettled* (as a representation of "not  
>> possible to compare this"). ... It has just occurred to me that  
>> this behavior is actually useful.
>>
>> Examples: 1. Hiding identity distinctions from clients:
>
> Interesting. Should the value caught by "} catch ex {" add identity  
> hiding to the opacity with which it wraps the thrown value?

I'm not sure. I'll try to think about it.

However, I just realized that this doesn't actually work, at least by  
itself: the creation identity of such an object can be distinguished  
by its traversal key -- unless we add the rule that traversal keys  
cannot be created for such objects. This would be consistent with the  
"cannot be compared" concept, but would require reevaluation of most  
of the uses of traversal keys.

For the uses of them I imagine, I don't see much wrong with e.g.  
refusing to serialize any "identityless" object -- but we should  
consider the choice carefully, and there might be other surprises  
waiting.

My conclusion (unless we think of some easy fix for this) is that the  
neat tricks aren't worth the semantic-complexity cost. We'll still  
have unsettled-selfless-leaf objects, but they will be  
distinguishable with traversal keys.

-- 
Kevin Reid                            <http://homepage.mac.com/kpreid/>




More information about the e-lang mailing list