[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Problem with Lua in c++ and stl
- From: Mike Cuddy <mcuddy@...>
- Date: Tue, 31 Aug 1999 22:55:54 +0100
> 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.
I've actually thought about adding "one-argument functions" to handle
thiscall's, but I'm not sure how portable that would be! I wonder
if this:
object->Func()
is ALWAYS the same as:
Object::Func(object)
(as object.func(object) == object:func() in LUA ;-)
Better to stick with the C->C++ bindings, methinks.
--
Mike Cuddy (mcuddy@FensEnde.com, MC312), Programmer, Daddy, Human.
Fen's Ende Software, Redwood City, CA, USA, Earth, Sol System, Milky Way.
I remember asking why ... Let it rain, and protect us from this Cruel Sun.
Join CAUCE: The Coalition Against Unsolicited Commercial E-mail.
<http://www.cauce.org/>