[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Type-checking trick
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 25 Jul 2002 12:44:06 -0300
Since you're going to have to write a thin C layer on top of the existing C API
to expose those functions to Lua, I think it is easiest to add type-checking
there. Perhaps a helper function such as
luaL_checkargs(L,"istf")
would be appropriate. This function would check the number and type of the
arguments by scanning the given string (i=int, s=string, t=table, f=float;
you get the idea).
This could also be easily done automatically with a tool like toLua or a simple
Lua script (I've used such scripts to write wrappers for mapm and pdflib).
--lhf