help?> @isdefined
@isdefined s -> Bool
Tests whether variable s is defined in the current scope.
Examples
≡≡≡≡≡≡≡≡≡≡
julia> function f()
println(@isdefined x)
x = 3
println(@isdefined x)
end
f (generic function with 1 method)
julia> f()
false
true
Yes, that only works for global variables. The @isdefined macro that works for locals requires language support and is not possible to backport to 0.6.x.