On 7 Nov 2018, at 15:47, Marcus Denker <marcus.denker@inria.fr> wrote:Hi,I addedas a workaround, you can use a #before link with an explicit return:choice := true.link := MetaLink new metaObject: [ :object :selector :arguments :context |UIManager default alert: 'Linked Version'.choice ifTrue: [ context sender sender sender sender return: (object perform: selector withArguments: arguments)].];selector: #value:value:value:value:;arguments: #(#object #selector #arguments #context);control: #before;level: 0.(TestMetaLink >> #execute) ast link: link.TestMetaLink new execute.link uninstall.(yes, the context sender sender sender shows that #context needs to do the right thing when using level: 0. or not��� another thing to fix)MarcusOn 7 Nov 2018, at 15:08, Marcus Denker <marcus.denker@inria.fr> wrote:Hello,I added a fist issue (and fix) for parts of the problemBut after this, it does not work as the level just turns off calling the meta level code, but does not execute theoriginal code where the #instead is put.(#instead in general needs more work in this implementation).I will open another issue for that.MarcusOn 31 Oct 2018, at 18:03, Vitor Medina Cruz <vitormcruz@gmail.com> wrote:Vitorregards,Thanks! Is there an issue on fogbuzz where I can be notified of resolution? Do you need me to create it?After that how can update the code? Software update is safe or should I create a new image?On Mon, Oct 29, 2018 at 12:08 PM Marcus Denker <marcus.denker@inria.fr> wrote:Hello,On 25 Oct 2018, at 01:33, Vitor Medina Cruz <vitormcruz@gmail.com> wrote: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 DictionaryAm I doing something wrong? Is that an error?Yes, this looks like a bug. I will fix it over the next days.Marcus