So I can use
@isdefined my_undefined_variable
and it returns false. But is there something similar without using the macro (a function)? There seems to be a function isdefined()
, but I don’t know how it works (not as I expected at least).
So I can use
@isdefined my_undefined_variable
and it returns false. But is there something similar without using the macro (a function)? There seems to be a function isdefined()
, but I don’t know how it works (not as I expected at least).
julia> x_sym = :x
:x
julia> isdefined(Main, x_sym)
false
julia> x = 1
1
julia> isdefined(Main, x_sym)
true
That’s great! Thanks!