lua-users home
lua-l archive

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


> And if you want to make your C-synced variable local in scope then
you've
> got a problem. In fact, I think it can't be done. :-(
> 
I don't want my C vars to be local but I want to be able to assign
values to them the usual way and not interfere with gloabal lua vars.
I set the "settable" method for the globls table but my method gets
called only when I assign to my C exported var(a userdata var that
is).That's what I want but is that normal or am I doing something
wrong?What if I set the setglobal and getglobal tag methods for my
userdata C vars?Wouldn't that do the job?

> In Lua4 there was special treatment for global accesses. As globals are
> stored in a Lua table, in Lua5 this was simplified by allowing access to
> that table and using data access metamethods. Local variables,
however, are
> still left unhandled.

Should I switch to Lua5 now or will porting my code to it later be
easy.I don't want to mess with beta software unless I have to(there
aren't debian packages for it either I think) but I don't want to
rewrite the whole thing again later when lua5 is released.

Dimitris