How do I find if a variable is defined when I know the corresponding symbol, but not the name?

I have a variable a that is defined:

a = 1

I can check whether a is defined

@isdefined a # true

Some other variables may or not be defined at this point in the program:

@isdefined b # false

However, I only have available a vector of symbols [:a, :b] and I want to check whether

the corresponding variables a and b are defined.

This does not help:

@isdefined :b # true

How can I find whether the variable b is defined if I only have the

corresponding symbol :b available?

if you need this you’re doing it wrong, that said

julia> isdefined(Main, :a)
false

julia> a = 3
3

julia> isdefined(Main, :a)
true

Thanks. I guess the problem was the macro.