In this example, we are using a native Lua object to which our proxy will forward all operations that are applied to it.
target = {}
p = Proxy(target, {})
p.a = 37 -- operation forwarded to the proxy
print(target.a) -- 37. The operation has been properly forwarded
See also
* "Lua is awesome" Brendan Eich presentation at LuaConf (slides)
* Lua Already Implemented This proposal page and Lua builtin features page
* Tutorial on Lua builtin feautures that were there since day one
* Old Javascript Proxy Attempt API page
and lua can actually do this more succinctly. I had to modify the usual style a bit to get it to fit with the javascript examples. Usually you don't need to introduce a proxy object and instead just make objects directly inherit from other objects.
i can't wait for ecmascript 6
holy shit
my dick is so hard
it has all the niceties of python
but more concise, 20x faster and with real lambdas, fast graphics and 2.5 billion people with access to auto updating runtimes.
2013 will be the beginning of a golden era in computing
>>27
Frankly, I don't blame them. It's entirely Microsoft's fault we're in this mess.
Name:
Anonymous2012-10-20 20:41
>>27
xp is being deprecated next year, and updates for ie9+ happen in background and their feature support is competitive with chrome/ff since microsoft is forced to take web/open source seriously by pouring money into node and so on.