2014-12-06 11:18 GMT+01:00 Marcus Denker <marcus.den...@inria.fr>: > > > On 05 Dec 2014, at 15:18, stepharo <steph...@free.fr> wrote: > > > > I would like to be able to express > > > > Compiler new > > bindings: { a -> 3. b -> 4}; > > evaluate: 'a + b'; > > result > > and get 7 > > > > How can I do that? > > > > Not directly, as evaluate is just a doit… but it can be added > as the machinery is there for evaluating in context in the debugger. > > I will have a look but not this weekend. > > Marcus > > > The easiest solution I have found:
Smalltalk compiler evaluate:'a+b' notifying: (Dictionary newFrom:{ WorkspaceVariable key:#a value:3. WorkspaceVariable key:#b value:4}) logged:nil The dictionary is used as the receiver for the call to #bindingOf: and WorkspaceVariable acts like a LiteralVariable that implements emitValue/emitStore nicolai