[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Userdata with methods *and* table access.
- From: Mark Hamburg <mhamburg@...>
- Date: Sat, 16 Oct 2004 14:52:27 -0700
See also: http://lua-users.org/lists/lua-l/2004-09/msg00400.html
I also endorse the notion of having a table swap function. I think I
suggested something like that once as well, but I may have just thought
about suggesting it.
Mark
on 10/15/04 9:24 AM, Lucas Ackerman at glitch@gweep.net wrote:
> However, I think this is a strong argument for increasing the ease of
> using proxy tables, since they are a prominent idiom in Lua 5. I've been
> thinking about adding the following:
>
> 1) A table internals swap (or identity swap if you like) function to
> efficiently proxy a table without losing identity.
>
> 2) Having a per-table proxy-mode flag to force __index and __newindex use
> regardless of existing keys. This is a kind of self-proxy or auto-proxy
> behavior. It would be much cheaper than always checking metatables, and
> it doesn't require an extra table like the typical proxy idiom does.
>
> These would allow use of either proxies or forced lookups (or both)
> conveniently, and are in the minimalist Lua spirit of extensibility.
>
> Lua does have its rough edges and room for growth, and your suggestions
> and participation are appreciated even if they don't provoke debate.