[Pharo-dev] Instrumenting field accesses with Opal?

Stéphane Ducasse stephane.ducasse at inria.fr
Wed Nov 13 16:32:08 EST 2013


>>> Hi!
>>> 
>>> Is there a way to get notified when fields are accessed?
>>> That would be awesome
>> 
>> You can use the current reflectivity prototype. It's on RMoD CI: https://ci.inria.fr/rmod/job/Reflectivity/
>> It should look like something like that:
>> 
>> YourClass methods do: [ :method |
>> 	method ast 
>> 		forAllNodes: [ :node | node isVariable and: [ node isInstance ] ]
>> 		putAfter: [ RFMetalink expression: 'Transcript crShow: ''iv accessed''' ];
>> 		installWrapper ].
> 
> In the end we should be able to just use the Slot MOP ;)
so cool 
:)






More information about the Pharo-dev mailing list