[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Validate parameters to Lua functions
- From: C++ RTMP Server <crtmpserver@...>
- Date: Fri, 8 Apr 2011 14:04:24 +0300
On Apr 8, 2011, at 12:18 PM, Robert G. Jakabosky 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?
Because is better to be safe than sorry :)
I'm not saying that the server will crash, but having a warning is a nice thing. At least count the parameters.
Is not a show-stopper not to have this functionality. I was just wondering ...
>
> Remember Lua is a dynamic language, don't try to enforce static typing.
I know that, but is going to be embedded into a C/C++ server as a place for handling events, not as a fire-and-forget lua application.
>
> --
> Robert G. Jakabosky
>
------
Eugen-Andrei Gavriloaie
Web: http://www.rtmpd.com