[e-lang] Fixes wanted: Auditor exprs break object reconstruction and auditing
Kevin Reid
kpreid at mac.com
Mon Oct 2 21:11:25 CDT 2006
? pragma.disable("explicit-result-guard")
? pragma.enable("easy-return")
I noticed this while adjusting my DeepFrozen auditor to work with the
new ObjectExpr (named by a pattern instead of a string), and found
that the auditor was in fact broken (approving stateful objects)
because of this quirk.
The auditor expressions of an ObjectExpr are a very strange thing.
They are part of the ObjectExpr, but, unlike every other part, are
closed over by the resulting object, rather than being code executed
later.
Particularly, what should the intended support for pass-by-
construction do with this case?
? def input := "aardvarks"
> def foo := Guard # or any other auditor
> def x := {
> def x implements (def bar := foo; def foo := input; bar) {
> to run() { return [foo, meta.getState()] }
> }
> }
# value: <x>
? x()
# value: ["aardvarks", ["&null" => <& null>, "&foo" => <&
"aardvarks">, "&__makeList" => <& <makeConstList>>, "&__return" => <&
<__return: disabled Ejector>>]]
As implemented, the values returned give the state of the object, but
are not sufficient to reconstruct it since the auditor is not present.
If "&foo" in the state map were to be the auditor instead, then part
of the actual state of the object would be missing.
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 believe this will also simplify correct auditing.
Please tell me what you think of this solution, and any alternatives
you can think of.
--
Kevin Reid <http://homepage.mac.com/kpreid/>
More information about the e-lang
mailing list