[e-lang] Fixes wanted: Auditor exprs break object reconstruction and auditing

Kevin Reid kpreid at mac.com
Wed Oct 4 12:39:32 CDT 2006


On Oct 4, 2006, at 12:24, Mark Miller wrote:
> On 10/2/06, Kevin Reid <kpreid at mac.com> wrote:
>> The only reasonable solution I've thought of so far is to consider  
>> the auditorExprs to be hidden, so that the object's script cannot  
>> use definitions from them; it will then be sufficient for  
>> meta.getState() to return the ObjectExpr's environment.
>
> I don't like my current behavior nor this suggestion, because  
> neither supports the following use-case. I propose that we seek a  
> spec in which an object can be pass-by-copy-by-mobile-code by doing  
> something as simple as the following:
>
>
> def x implements ..., PassByCopy, ... {
>     to __optUncall() {
>         return [__eval, "run", [meta.context().getSource(),  
> meta.getState()]]
>     }
>     ...
> }

I am quite aware of this intent, and I do not see how my proposal  
prevents it. The bindings used by the auditor exprs would be included  
in meta.getState().

When I say hidden, I mean in the sense of a HideExpr; the bindings  
*made* by the auditor exprs would not be visible to the script.

> In order for this to work reliably, we could specify that the  
> variables captured and reported by meta.getState() include those  
> used freely by the auditorExprs (therefore including PassByCopy),  
> as well as those used freely within the object itself.

Of course.

> A draconian by simple way to avoid the scope confusion issues you  
> raise is to outlaw them: We could say that none of the auditorExprs  
> may shadow any variable
> used freely by any previous occurrence in the same implements list.

I don't see how this is necessary or relevant. The auditorExprs  
together are scoped like an argument list/sequence, so any bindings  
made by them are internal and do not need to appear in meta.getState().

> Further, if necessary, we could say that the object itself may not  
> use freely any variable defined by any of the auditorExprs, and  
> that therefore meta.getState() must contain all the object's  
> instance variables.

I agree that this would also be a solution to the original problem.

It would be equivalent to state that auditor exprs are hidden, and  
furthermore that their names may not /appear/ to be reused, much as  
we do in cases of apparently reversed scoping (e.g. 'for'). This  
seems cleaner to me at the moment, because the semantics minus  
"confusing scope restrictions" then do not have the original problem.

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




More information about the e-lang mailing list