I'm trying to do some table trickery with the __newindex()
metamethod, but I can't actually create a new entry in the table from inside of it unless I nil-ify the __newindex
key first, because it'll just recurse back into it when I try to set something.
Supposedly, we're meant to use rawset(t,k,v)
to create keys safely while inside there, but we don't have access to that on pico.
@zep, is there any chance you could give us access to rawset()
in the next version, so I can do this properly? Setting the metamethod to nil and then restoring it just feels horribly inefficient and klunky, since it triples the work needed when I first set vec.x=123. I hope this is just an oversight in the list of exported Lua features.
Edit: Apparently there's a rawget()
too. I should probably ask for that as well.
Please? :)
PS: Also, since I'm being all greedy anyway, next()
would be nice too. ;) But not as important.
[Please log in to post a comment]