You're probably not passing a symbol for the second argument: julia> isdefined(:sum) true
julia> isdefined(:foo) false julia> isdefined(Base, :foo) false julia> isdefined(Base, :sum) true If you call isdefined(foo), then it first tries to evaluate the variable "foo" and pass the result to "isdefined", but evaluating "foo" throws an error if "foo" is not defined. In contrast, :foo is a symbolic expression that refers to the "symbol" foo, which it doesn't try to evaluate. On Thursday, May 22, 2014 3:19:41 PM UTC-4, Cirrus McInnis wrote: > > New to Julia.. > > I'm just trying to test for a var's existence. isdefined() seems to be > the tool to use. > If the result is true then "true" is returned. > If false, "x not defined.." is returned. Shouldn't it return "false"? > > Is there another way to test for existence? > > -David >
