lua-users home
lua-l archive

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



-----Original Message-----
From: David Given [mailto:dg@cowlark.com] 
Posted At: Friday, November 19, 2004 7:49 PM
Posted To: LUA
Conversation: (Feature Request) Custom Attributes. [bcc]
Subject: Re: (Feature Request) Custom Attributes. [bcc]

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 }
}

Of course, this adds real table element into the table, which is
run-time overhead, for later for traversing or cloning this table, it
will also have an impact on the GC time.

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.

Yes, attributes are syntactic sugar, but very useful one, and for a good
reason included in C# for example, although it does have reflection
interface.
Doing it in Lua-ish way just seems like a fast hack.
Of course for Lua itself they are not needed, but for embedding Lua into
the other apps they will be very useful.


- Timur

____
This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. Crytek GmbH - http://www.crytek.com