Converting an existing object to a proxy

Sean Eagan seaneagan1 at
Fri May 27 11:05:02 PDT 2011

On Fri, May 27, 2011 at 12:43 PM, Sean Eagan <seaneagan1 at> wrote:
> Of course you could go the other way, and remove the default trap
> implementations.  All objects could have the same internal method
> implementation regardless of whether or not they are a proxy.  Within
> each internal method there could be a check as to whether the object
> is a proxy (has a [[Handler]]) AND has the trap, if so, it is invoked,
> otherwise the default pseudocode is performed.

The pseudocode for checking if the object has a [[Handler]], and if
that [[Handler]] has a trap, and then invoking the trap could all be
factored out into a [[Trap]] (or something) internal method, which
takes a trap name, and a list of arguments to pass to the trap, and
returns whether or not the object has the trap, and if so, also a
return value from the trap.  This would make for a very concise and
clear spec with regard to proxies, and it would be relatively easy to
update the current proposal to do this.

Sean Eagan

More information about the es-discuss mailing list