#before and #after links!

Hi,

After loading this:
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
Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: