[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Fields in userdata ?
- From: erik@... (Erik Hougaard)
- Date: Wed, 09 Dec 1998 09:43:29 +0100
This is what I would like: (Im just throwing this out for discussion!)
A userdata type with field addressing:
Customer.Name = "Erik Hougaard"
Customer is a userdata, Name is "just" a field in my userdata.
I will have defined a "write" function to my userdata like this:
void WriteFieldValue(lua_Object LO,char *FieldName)
// Do all the stuff needed... Value "Erik Hougaard" is on stack!
I will have defined a "read" function to my userdata like this:
void ReadFieldValue(lua_Object LO,char *FieldName)
// Push field value to stack!
What should be done:
1. To a tag there should be option to add a "read" and a "write"
2. Userdata should be allowed in expressions ??
3. Lua should keep the "fieldname" for passing.
4. Call the "read" and "write" functions
So what do you think... Is there a better / Easier / Slicker way to do