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

Benjamin Benjamin.VanRyseghem.Pharo at gmail.com
Fri Dec 6 04:25:53 EST 2013


I also think you should have a look at Phantom :)

Maybe Johan will give you more details :)

Ben

On 06 Dec 2013, at 10:14, Torsten Bergmann <astares at gmx.de> wrote:

> 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
>> 
>> 
>> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20131206/09dedcbb/attachment-0002.html>


More information about the Pharo-dev mailing list