Re:Q: A way to determine if function is defined [repost]
listproc choked in this one. --lhf
>From [hidden email] Tue Mar 14 09:20:57 2000
>Date: Tue, 14 Mar 2000 12:18:55 GMT
>From: "Paul Winwood"<[hidden email]>
>To: <[hidden email]>
>Subject: Re:Q: A way to determine if function is defined
Assuming that I understand your question correctly then
I use the built in function 'type' which returns the type of
the referenced object which for a function is the string 'function'.
for example consider the following LUA fragment:
-- note: noname is not declared.
write("type of 'named' is "..type(named).."\n")
--> returns type of 'named' is function
write("type of 'noname' is "..type(noname).."\n")
--> returns type of 'noname' is nil
Subject: Q: A way to determine if function is defined
Author: <[hidden email]>
Date: 14/03/2000 08:32
Is there a method in Lua to check from within a script if the function is
I mean, before "call expression not a function" error appears.
What I figured out, is trying to invoke the function in question using
"call", providing own handler.
Does anybody know nicer solution?