What's wrong with this macro?

It could very well be! Any alternative to @isdefined then?

EDIT: I’ve changed @isdefined with a custom one from https://discourse.julialang.org/t/check-whether-a-variable-is-defined/1018/3?u=jlapeyre which should work in local scope too, but, once again, without success.

EDIT 2: It turns out that, in this case, Julia correctly uses Base.@isdefined instead of Core.@isdefined, which is able to deal with the current scope.

1 Like