lua-users home
lua-l archive

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


Hi,
I just finished reading through the first two section of the reference
manual.So regarding my initial question:

> >I was wondering wether it's possible to do any of this in Lua:
> >1)'export' a C variable meaning that you create a lua var which is 'in
> >sync' with a C var.And what's more important...
> 
> Yes. Use userdata containing the address of the C variable and add
metamethods
> to handle reading and writing to it.

I didn't see a metamethod for the assignment operator in the
manual.For reading I can use the function metamethod so that you can
read the value just by typing the name but what metamethod can I use
for writing to it?Can I define my own metamethods?Did I miss something
in the manual?

Dimitris