Open
Description
The word "toplevel" is used in a few places in the documentation, but not actually defined or discussed in any depth at all. But then there is at least one situation where it has to be used in code, with no reason is given. Specifically, one would think that this code should work:
macro mymodule(name)
modname = esc(name)
return :(module $modname end)
end
@mymodule MyMod
And in fact, it used to up to Julia 1.4. But now, that macro mysteriously needs to
return Expr(:toplevel, :(module $modname end))
Why?! The output from the first one isn't hidden in a block or anything; it would appear to be at the level at which it was run — the top level, as far as I can see.
I've asked on discourse with no response, but anyway I think something about this should be somewhere in the docs.