lua-users home
lua-l archive

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


Hello :-)

I have got a question about debug.getupvalue :
why is it forbidden to get an upvalue value
from a C function in Lua ?

Line 182 in ldblib.c, it is clearly said that
we cannot touch C upvalues from Lua (see the
code comment). I can understand that it would
be forbidden to set a C upvalue from Lua, but
why not being able to get it after all ?

The reason for why I am asking is : I would like
to associate some "meta" information with C
functions made available to Lua, without too
much overhead and I thought that I could use
upvalues, even if it's not designed for it ;-)
Then, I would like to be able to retrieve this
information without much effort as well.

Thanks in advance for your explanations,
cheers,
Matias.