问题
Is there a way to export all symbols in a Julia module (something like the semantic counterpart to importall
)? Such a functionality would be very useful when the number of symbols to be exported grows large. TIA.
回答1:
There's the Reexport.jl package that provides a form of this; it's use case is when you have a submodule and you want to reexport all of the exported symbols from the inner module into your current module. I know, not exportall
, but part of the functionality.
回答2:
I wrote a minimal ExportAll.jl package. It works and is tested for Julia 1.1.1 and it is available as a Julia package. Basically, it exports all symbols(!) defined in a module that is not part of any of the core modules. Disclaimer doing things like this is not good practice and should only be done with great care.
来源:https://stackoverflow.com/questions/25203560/exporting-all-symbols-in-julia