Is there a function to check if a function or variable is declared?