[ top | up ]

Is a Symbol Bound?

Syntax

exists(x, envir=null, mode="any", inherits=false)

Arguments

x a symbol (given as a quoted string).
envir an environent to be searched.
mode the type of interest for the object.
inherits should the enclosing frames of the environment be inspected.

Description

exists looks to see if the symbol x has a value bound to it. If envir is null then the the currently active environment is searched first. If inherits is true and a value is not found for x, then the parent frames of envir are searched until the symbol x is encountered. If mode is specified then only objects of that mode are searched for. exists returns true if the symbol is encountered and false if not.