A proxy is an eventual reference whose behavior is specified by other references.
The new proxy maker protocol, which is robust and available as a safe import. See  and the nearby thread for the discussion of its creation.
- Creates a new proxy. handler is the handler for messages sent to the proxy; resolutionSlot specifies the resolution (see below); far is true if the proxy is to be a Far ref and false for a remote promise.
For a given handler and resolutionSlot,
- all results of makeProxy.run(handler, resolutionSlot, false) are the same.
- all results of makeProxy.run(handler, resolutionSlot, true) between which resolutionSlot has not further resolved (as in TraversalKey) are the same.
The resolutionSlot should be a vow for a FinalSlot whose value is the reference to which this proxy resolves. As soon as resolutionSlot is itself resolved, the proxy will turn into its resolution; handler will never again be invoked.
Far proxies may only be resolved to broken references; if the resolution is something else, or if resolutionSlot resolves to something not a FinalSlot, then the proxy will resolve to a broken reference whose (sealed, if applicable) problem indicates that error.
Send and sendOnly on a proxy send the corresponding
handle* messages to handler. Ref.optSealedDispatch on a proxy calls handler
Rationale for resolutionSlot
The old ProxyResolver facility was a Resolver which could resolve the proxy. The problem with this interface is that, since it is imperative, the proxy's total behavior depends on the holder of the resolver and not solely on its components. Therefore, ProxyResolver clients could make two proxies which are allegedly the same but actually differ in behavior (different resolutions). Using a promise to specify the resolution avoids this possibility because promises can be compared.
The reason a promise for a slot containing the resolution is used, rather than a promise for the resolution, is so that the resolution itself being a promise can be distinguished from the resolution not having occurred yet.
Protocol for the handler supplied by the client of makeProxy.
- handleSend(verb :String, args :List) :any
- handleSendOnly(verb :String, args :List) :any
- handleOptSealedDispatch(brand) :any
XXX document these