[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Problem with Lua in c++ and stl
- From: David Jeske <jeske@...>
- Date: Tue, 31 Aug 1999 21:57:14 -0700
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
David Jeske (N9LCA) + http://www.chat.net/~jeske/ + email@example.com