lua-users home
lua-l archive

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


>what are you hoping to do with such information?
I want to give the users more accurate error message to accelerate the
debugging process.
For example, if the value provided by the user is out of range, I hope
to tell the user the variable named 'foo' is invalid(instead of
telling them the first or second parameter is invalid).

On Wed, Jan 20, 2021 at 5:29 PM Sean Conner <sean@conman.org> wrote:
>
> It was thus said that the Great 孙世龙 sunshilong once stated:
> > We can push self-defined C function to lua_register.
> >
> > But how to acquire the name of the variables passes to the
> > aforementioned self-defined C function?
> >
> > I would be grateful to have some help with this question.
>
>   Assuming I have a function foo() that's been defined in C and
> lua_register() has been called on it, what should the names of the variables
> be in the following cases?
>
>         foo(3)
>         foo("a simple string")
>         foo(true)
>         foo({ 1 , 2 , 3 , 4 })
>
>   Second question:  what are you hoping to do with such information?
>
>   -spc
>