Hello,
I am playing with MetaLink, really cool!, but I am having issues that I am unsure if it's some erro or if I am doing something wrong (I am using Pharo 6.1 32 bits in windows.). Consider:
TestMetaLink>>execute
UIManager default alert: 'Actual Version'.
And in Playground:
| link |
link := MetaLink new metaObject: [ :object | UIManager default alert: 'Linked Version' ];
selector: #value:;
arguments: #(#object);
control: #instead.
(TestMetaLink >> #execute) ast link: link.
TestMetaLink new execute.
link uninstall.
This works as expected, an alert with 'Linked Version' is promped. But then suppose I want to execute the actual node alongside with the linked one considering some condition:
| link choice |
choice := true.
link := MetaLink new metaObject: [ :object :selector :arguments |
UIManager default alert: 'Linked Version'.
choice ifTrue: [ object perform: selector withArguments: arguments].
];
selector: #value:value:value:;
arguments: #(#object #selector #arguments);
control: #instead;
level: 0.
(TestMetaLink >> #execute) ast link: link.
TestMetaLink new execute.
link uninstall.
As I understand, level:0 is necessary in order to avoid an infinite loop, but then I get an error:
KeyNotFound: key #RFArgumentsReificationVar not found in Dictionary
Am I doing something wrong? Is that an error?