You can write the sub-module code in a separate file, and then include() it in the main source file. That's how do e.g. in Debug.jl<https://github.com/toivoh/Debug.jl/blob/master/src/Debug.jl> . That said, Tim's option might be better in this case.
On Thursday, 6 March 2014 14:06:22 UTC+1, Carlos Becker wrote: > > I am working on a module and I wanted to separate the 'raw' processing > part from the visualization-related functions. > I thought of having a base module (eg MyBaseMod) and then a submodule > (MyBaseMod.Viz) for visualization. > > Since some MyBaseMod.Viz needs PyPlot, I want to be able to use MyBaseMod > without the visualization part, so that it doesn't need PyPlot. > However, AFAIK, it is not possible to place MyBaseMod.Viz in a different > file than MyBaseMod, because it will then replace previously included > MyBaseMod, right ? > > Is the best option to split it into two modules, rather than submodules? > > Thanks. >