On 5 March 2013 12:53, Bert Freudenberg bert@freudenbergs.de wrote:
On 2013-03-05, at 02:40, Colin Putney colin@wiresong.com wrote:
On Mon, Mar 4, 2013 at 5:09 PM, Igor Stasenko siguctua@gmail.com wrote:
you mean changing compiler to compile "<obj> Foo" message send for accessing Foo name, instead of direct binding access?
Oh, I see. The source code still reads as a variable access, but the bytecode implements a message send.
No, I think Igor is proposing to write something like "self environment Foo" to access Foo. Which is flexible, granted, but looks ugly.
i making a prototype implementation right now.. so you can look and see.
The trick is in compiler.., when it sees:
someMethod ^ Foo
it compiles it not to "read from literal binding" bytecode but to "push <special object> send #Foo" .. so it is message send for global variable access
then it is all about that <special object> which understands and/or handles #Foo message to answer a proper result.
- Bert -