lua-users home
lua-l archive

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


On Friday 19 November 2004 18:28, Timur Davidenko wrote:
> This solution will require manual sync of names in multiple tables, can
> get quite complex with several levels of hierarchy in sub tables.
> Plus it add`s a runtime overhead for accessing this table, which is
> better to avoid in such cases.

(Please don't top-post!)

If you're going to attach the attributes to the table elements, you'll have to 
have a run-time hit. If you attach the attributes as related data, you'll 
have a compile-time hit, which you could ameliorate by using helper tools.

Is anything wrong with:

Table = {
 Radius = 10,
 Radius_attr = { UIWidget = "slider", UIMin = 0, UIMax = 100 }
}

...?

It sounds like what you want is some syntactic sugar that's specific to your 
particular problem, which makes me suspect that by restructuring the problem 
slightly you could solve it in a much more Lua-ish way.

-- 
+- David Given --McQ-+ "...you could wire up a *dead rat* to a DIMM
|  dg@cowlark.com    | socket, and the PC BIOS memory test would pass it
| (dg@tao-group.com) | just fine." --- Ethan Benson
+- www.cowlark.com --+