Interesting... Thierry 2018-05-22 14:18 GMT+02:00 Marcus Denker <marcus.denker@inria.fr>:
On 18 May 2018, at 10:39, Marcus Denker <marcus.denker@inria.fr> wrote:
Hi,
the #binding: API until now did not allow to shadow globals. But there is actually no reason to forbid that (and it can actually be interesting, e.g. to compile code where one class ref is switched to another).
The Pull Request does:
- add comment to OCExtraBindingScope - categorize tests - change #lookupVar: to allow shadowing of Globals. - change test to reflect the new behaviour
This means you can do:
result := Smalltalk compiler bindings: {(#Object -> Point)} asDictionary; evaluate: 'Object new'.
A second iteration now makes it work correctly for assignments:
https://github.com/pharo-project/pharo/pull/1397
Smalltalk compiler bindings: {(#test -> Point)} asDictionary; evaluate: 'test := 42'.
Marcus