Usage of isdefined() function

I recently returned to some code I wrote last year, where I used the isdefined() function. The old syntax was:

julia> x = 1
julia> isdefined(:x)
julia> isdefined(:y)

But since then isdefined() has changed and now takes two parameters, and I really can’t figure out from the help file what I’m meant to be adding to make this work. In this particular case a is an Int, but it could be anything.

How should I be using this function correctly?

It is very likely that you want the macro form @isdefined instead.

Ah, that wasn’t working for me, but then I noticed that the old syntax was isdefined(:x), and I was trying @isdefined :x, when should have been @isdefined x. I’ve changed that and it seems to be working now, thank you.

I’ve updated the code in the original post in case anyone else wanders across this.