Hi, 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 https://github.com/peteruhnak/metalinks-toolkit . But of course you can attach the MetaLink directly. P On Fri, Feb 1, 2019 at 12:43 AM Petr Fischer via Pharo-users < [email protected]> wrote: > Hello, > > is possible to intercept (before writeú all instance variable writes on > every existing objects? > > I found a discussion here: > > http://forum.world.st/Is-it-possible-to-follow-an-object-through-a-computation-td5092459.html > > 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 > > > >
