lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Alexander Gladysh wrote:
> On Wed, Jan 19, 2011 at 21:46, Tony Finch <dot@dotat.at> wrote:
> > You can do that with a proxy table. Point __index at the table to be
> > cloned, and when __newindex is called, copy everything to the proxy.
> 
> Thank you. As I noted in my original post, I'm aware of that solution.
> 
> My question is about LJ2 optimizations.

Well, this is at the wrong level for a compiler optimization. How
could it do better than that? It would have to do exactly the same
things behind the curtains. It's not the compiler's business to
handle stuff you can do at the user level with similar efficiency.

[And I'm pretty sure it doesn't pay off either way. Rethink the
whole thing and find easier ways to do what you're really trying
to achieve. This sounds a lot like architecture astronautics.]

--Mike