lua-users home
lua-l archive

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


On Wed, Sep 01, 1999 at 01:19:32AM -0300, Mike Cuddy wrote:
> // it's a pity that cfunction's in lua don't get to carry userdat, then we
> // could pass the object "implicitly" to the C -> C++ binding function.
> // instead of digging it out of a table.

Unfortunatly, it's not as simple as having a cfunction carry a
userdata. There is no portable way to build an argument list to pass
to a function call in C. On some platforms arguments are all passed on
the stack, on other platforms some arguments are passed in registers.

However, lua could provide simple "one argument" and "zero argument"
functions. The one argument case would handle C++ methods pretty
well. I'll have to see how much cleaner this would make my C++<->Lua
code.



-- 
David Jeske (N9LCA) + http://www.chat.net/~jeske/ + jeske@chat.net