gcv / julia-snail

An Emacs development environment for Julia
GNU General Public License v3.0
231 stars 21 forks source link

use `:toplevel` in `eval_in_module` #78

Closed MasonProtter closed 2 years ago

MasonProtter commented 2 years ago

Before this change, if you did

macro foo(ex)
    @show ex
end

@foo 1

and tried to eval all of that in module using julia-snail-send-region or whatever, you'd get an error saying that @foo is not defined. This change makes it so that julia will first define the macro before trying to expand the macro. This also fixes the same issue if you tried loading a macro from a package in the same code unit that you try to use that macro in.

gcv commented 2 years ago

Nice catch! Thank you for contributing to Snail.