Re: __update metamethod — intercept wr ites to existing keys (patch for 5.5.0)
Yan <[email protected]>
| Newsgroups | gmane.comp.lang.lua.general |
|---|---|
| Message-ID | <[email protected]> |
Agreed. With __update in place, there's no need for a 'proxy' table — we can use the real table directly, and reads can access fields from the real table without going through the proxy table's __index metamethod. 在2026年4月10日星期五 UTC+8 01:09:29<Martin Eden> 写道: On 2026-04-09 18:01, Rett Berg wrote: Currently we will create empty "proxy" table, store real table in closure, and use __newindex again. Ugly but works. With proposed __update we will use real table and use __update and __newindex. Code duplication but okay. If __update was proposed to replace __newindex then we will just use real table and __update. Neat. -- Martin -- You received this message because you are subscribed to the Google Groups "lua-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/lua-l/05592736-9172-4f17-befe-8b8106ccb87fn%40googlegroups.com.