[Pharo-dev] [Spy] How to inject code *inside* a method

Torsten Bergmann astares at gmx.de
Fri Dec 6 04:14:51 EST 2013


Hi Roberto,

usually what you need is support for so called ABIA (Around, Begin, Inner and After) execution.
Brings Smallscript back to my brain which had nice support for this.

In Squeak there was AspectS, I dont know if there is a port of AspectS for Pharo.

Maybe the PHANtom project can be of help here as it claims to be a modern aspect language
for Pharo:

http://de.slideshare.net/esug/phantom-a-modern-aspect-language-for-pharo 

Hope this helps

Bye
T.

> Gesendet: Freitag, 06. Dezember 2013 um 10:00 Uhr
> Von: "Roberto Minelli" <roberto.minelli at usi.ch>
> An: Pharo-dev <pharo-dev at lists.pharo.org>
> Betreff: [Pharo-dev] [Spy] How to inject code *inside* a method
>
> Hi guys,
> 
> I am using Spy for my project, and I need to do something which, on top of my knowledge, is not supported.
> 
> Here is the point: Spy allows to insert code before (#beforeRun:with:in:) and after (#afterRun:with:in:) and works perfectly.
> 
> Now suppose I want to inject some code *inside* the method, e.g.,
> 
> aMethodToBeProfiled
> 
> 	do something
> 
> 	"Injected code accessing some fields of the current instance of this object”
> 	Transcript show: self field asString.
> 
> Is there any support for this?
> 
> Thanks in advance,
> R
> 
> 
>




More information about the Pharo-dev mailing list