Re: Re[2]: exporter
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Re[2]: exporter
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: 2002年5月29日 09:56:52 -0300
>it possible to register a C function "int average(int a, int >b) { return (a+b)/2;}" to lua ?
No, it's not. C functions to be used with Lua must follow a protocol to receive
and send results. There are tools that make this glue code automatically and
so it may seem that an ordinary C function is being exported to Lua as is, but
this is an illusion (but a very nice one). Look for "code wrappers" in
lua-users.org.
--lhf