# What's wrong with this macro?

**URL:** https://discourse.julialang.org/t/whats-wrong-with-this-macro/49419
**Category:** General Usage
**Created:** [November 1, 2020, 5:46pm UTC](https://discourse.julialang.org/t/whats-wrong-with-this-macro/49419 "2020-11-01T17:46:48Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![giancarloantonucci](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giancarloantonucci/32/202551_2.png) [@giancarloantonucci](https://discourse.julialang.org/u/giancarloantonucci)
#### Post date: [November 1, 2020, 7:17pm UTC](https://discourse.julialang.org/t/whats-wrong-with-this-macro/49419/8 "2020-11-01T19:17:28Z")

</div>

> [@johnmyleswhite](#):
>
> Is the problem that `isdefined` doesn’t handle local scope?

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](https://discourse.julialang.org/t/check-whether-a-variable-is-defined/1018/3) 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`](https://docs.julialang.org/en/v1/base/base/#Base.@isdefined) instead of `Core.@isdefined`, which is able to deal with the current scope.

---

_[View the full topic](https://discourse.julialang.org/t/whats-wrong-with-this-macro/49419)._
