lua-users home
lua-l archive

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


Check to see if it's name is nil or not?

if bob == nil then 
    print("bob doesn't exist")
else
    print("bob exists")
end

If you want to be extra careful, you can check the type of bob to see if
it's a function or not. All this checks for is if a certain name is in use.

On Mon, 26 Nov 2001 15:52:11 -0500
"Jens Wessling" <wessling@soartech.com> wrote:

> Is there an easy way to tell if a function of a given name has been
> registered?
> 
> --jnw
> 
>