Some combination of the following is helpful to me
- An exportall(mod::Module)` function
function exportall(mod)
for n in names(mod, all = true)
if Base.isidentifier(n) && n ∉ (Symbol(mod), :eval)
@eval mod export $n
end
end
end
I have this in my startup.jl
- A
main()
function inside the module which looks like
function main()
@eval Main begin
...
end
end
The only problem is that you need to make sure you run exportall
before main()
This has a nice combination of
- Revise.jl works
- You can play around with functions inside your module
- The temporary variables you make at the REPL aren’t visible inside your module, so you don’t accidentally define global things that get used in your module.