Hi,

After loading this:

        
https://pharo.fogbugz.com/f/cases/15196/Simple-before-and-after-links-with-minimal-disturbance
 
<https://pharo.fogbugz.com/f/cases/15196/Simple-before-and-after-links-with-minimal-disturbance>

Simple after and before MetaLinks are taken into account, with just one check 
in #visitNode of the ASTTranslator that is
false when no links are there. (which means this slice should not impact 
anything)

For now this is for very simple MetaLinks: no parameters, no condition, no 
reification, no #instead/around, 
no meta-level modelling.

Here is a trivial example:

1) get a AST node from our example method:

sendNode := (ReflectivityExamples>>#exampleMethod) ast body statements first 
value.

2) then we define a link that is just #halt:

link := MetaLink new 
        metaObject: Halt;
         selector: #now.

3) we set it:

sendNode link: link.

4) when we now execute the method, we get a halt:

ReflectivityExamples new exampleMethod

5) to get rid of it, uninstall the link:

link uninstall.

If you look at the byte code, you see that it compiles the link to the code:

25 <20> pushConstant: Halt
26 <D1> send: now

        Marcus

Reply via email to