lua-users home
lua-l archive

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


With regard to __setindex, I was just thinking this morning about the costs associated with creating read-only tables and thinking that it would be worth benchmarking the approach of using a stub userdata:

	ud.mt = { __index = read-only-table }

And using a proxy table:

	{}.mt = { __index = read-only-table, __newindex = error-function }

__setindex would be the simplest option but would then need to be benchmarked for its effect on all table assignments.

Mark