Converting an existing object to a proxy

Sam Tobin-Hochstadt samth at ccs.neu.edu
Fri May 27 06:54:08 PDT 2011


On Fri, May 27, 2011 at 5:45 AM, Tom Van Cutsem <tomvc.be at gmail.com> wrote:
>> I tend to agree with David about having a separate observable API, if that
>> is indeed the driving use case. That API can be very similar to the Proxy
>> API though. Racket's "chaperones" come to mind: a chaperone is a strictly
>> less powerful kind of proxy, one that is not allowed to arbitrarily change
>> the result of the original operation (and IIRC, a chaperone also cannot stop
>> the original operation from taking place on the target object).
>
> Spoke too soon: from
> <http://web.mit.edu/drracket_v501/share/racket/doc/reference/chaperones.html>
> I learn that chaperones can throw exceptions, and thus presumably abort an
> intercepted operation early. Still, the idea of a "tamed" kind of proxy is
> worth exploring.

I believe that the semantics of observers allow for throwing
exceptions, and thus terminating an operation, at least according to
the wiki page.
-- 
sam th
samth at ccs.neu.edu


More information about the es-discuss mailing list