[Pharo-users] How to intercept every instance variable write on all objects
i.uhnak at gmail.com
Sat Feb 2 09:48:28 EST 2019
3) Metalinks - it's based on intercepting method calls, right? But I need
to intercept direct instance variable write, so probably not possible
no, you can attach metalink to any AST node, including an Assignment Node.
Some years ago I've made a small utility for this that also
auto-reinstalled when the method has changed.
Should work with P6, not sure about the current P7
But of course you can attach the MetaLink directly.
On Fri, Feb 1, 2019 at 12:43 AM Petr Fischer via Pharo-users <
pharo-users at lists.pharo.org> wrote:
> is possible to intercept (before writeú all instance variable writes on
> every existing objects?
> I found a discussion here:
> Known solutions:
> 1) jugglery with object read only state + ModificationForbidden - not
> ideal, it's probably slow via exceptions and every nested on:do: stop
> change detection
> 2) it's possible to do it via slots - but it does not work on any existing
> object (only on my specially prepared objects with slots)
> 3) Metalinks - it's based on intercepting method calls, right? But I need
> to intercept direct instance variable write, so probably not possible
> Is there any way? Thanks! pf
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pharo-users