Being able to proxy to another object is such an important feature,
that even in ES6 (aka "Javascript") there is a Proxy object [1] that
allows you to intercept/redefine operations for that object.

In the case of Smalltalk, and coming back to the original topic of
this thread, that is even more powerful because you have first class
messages that can be resolved via DNU handling. If anything, I would
like to give the receiver of a message more control of the handling of
such a message rather than having a DNU as the last resort, or worse,
some messages that are written to be sent, but then are inlined during
execution.

Regards,

[1] 
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy

Esteban A. Maringolo

On Mon, Mar 21, 2022 at 5:47 PM Tim Mackinnon <tim@testit.works> wrote:
>
> This has been an interesting thread to read on the side, and I appreciate the 
> thought provoking conversion.
>
> On Sun, 20 Mar 2022, at 6:11 AM, Richard O'Keefe wrote:
>
> An override of #doesNotUnderstand: *is* (an instance of) the problem.
> What part of "you may think you know what to forward now, but just
> wait a couple of months or install an additional package and there
> will be *more* selectors you needed to think about but didn't" is
> hard to understand?
>
>
> However I am confused by the above - as in Pharo and Dolphin (and I suspect 
> other Smalltalks) - you don't have to make your proxy a subclass of Object 
> right? If you want to forward as much behaviour as possible - you can 
> subclass ProtoObject (or equivalent). The width of methods on that is much 
> reduced (59 from a quick glance), and loading other packages doesn't tend to 
> extend at that level, so keeping things much more stable. The downside, is 
> that such objects are tricky to view in an inspector etc.  There is a mocking 
> framework in Pharo called Ghost that leverages this quite well from memory.
>
> So I think that some of the side arguments on downsides might not be quite as 
> bad as indicated.
>
> Tim
>
>

Reply via email to