Login  Register

Re: How can I specify the bindings when evaluating an expression?

Posted by stepharo on May 09, 2015; 4:42pm
URL: https://forum.world.st/How-can-I-specify-the-bindings-when-evaluating-an-expression-tp4794352p4825463.html

Nice :)


This Slice adds an API to the compiler to set a dictionary with bindings to be taken into account.
They are compiled as pushLinteralVariable: (thus refer to the association of the dictionary)

Smalltalk compiler
        bindings: { #a -> 3 } asDictionary;
        evaluate: '1+a'.

Internally this for now (ab)-uses the #requestor: API... later we will change this to be inverted: the requestors
should privide binding and get notified using Announcements.