[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Q: A way to determine if function is defined
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 14 Mar 2000 09:02:33 -0300 (EST)
>From email@example.com Tue Mar 14 08:39:35 2000
>From: "Maciej Maczynski" <firstname.lastname@example.org>
>Is there a method in Lua to check from within a script if the function is
To check whether f(x,y,z,...) is ok, just do
if type(f)=="function" then f(x,y,z,...) else do-something-else end
However, this will not work if f is an object for which there is a "function"
>What I figured out, is trying to invoke the function in question using
>"call", providing own handler.
This should work in all cases.
>Does anybody know nicer solution?
What exactly are you trying to do?