lua-users home
lua-l archive

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


On Fri, Apr 8, 2011 at 2:18 AM, Robert G. Jakabosky
<bobby@sharedrealm.com> wrote:
> On Friday 08, C++ RTMP Server wrote:
>> Bottom line:
>> Is there any lua api for further describe a LUA_TFUNCTION in greater
>> detail? (parameters count, types, return type, etc)? Even if I have only
>> parameters count is still better than nothing.
>
> No, there is no way to get that info with the Lua C API.
>
> Also function parameters have no type and there is no return type for a
> function.
>
> Why are you trying to validate the parameters of a function?

So there's no way to do that as a function of the language, but if
you're talking about API design...

The suggestion that you parse the Lua script can made be manageable by
telling the users what variable names to use in their function
declarations. If the functions take the variable names you expect and
the variables validate then you've enforced your model. If your
concern is usability than security then you could even make validation
optional.

Chris
--
She woke this morning, loaded up with bullets and stole a gun.
That is not a typical Wednesday.