I surmise that there's a lot of "include"-using Julia code out there
because it's the first way that the manual section on "Modules" tells you
about putting code in multiple files.

In fact, from the manual, it's really unclear to me how one should
distribute code among different files without using "include". The manual
mentions very briefly that Julia "searches for modules", but it doesn't say
how. Is it assuming some intuition that comes from Matlab? I know my Python
intuition doesn't work at all here.

In practice, almost all the Julia code I've written has been one-off single
files, with occasional cases where I made a module by trial and error.

The manual section on modules is too much about what you *can* do, and not
enough about what you *should* do. I'm looking for some good documentation
about best practices for organizing real Julia code.

On Mon Dec 29 2014 at 3:33:00 PM Jason Merrill <jwmerr...@gmail.com> wrote:

> On Monday, December 29, 2014 2:44:55 PM UTC-5, Tobias Knopp wrote:
>>
>> The lack of module merging (see exportall, reexport,...) makes include
>> more necessary than it might be.
>>
>
> `exportall` is a much better idea than `importunexported` from my post
> above. I.e. the child module would call `exportall` and the parent module
> would call either `importall` or `reexport` depending on whether it wanted
> the child's symbols to be exported or not.
>
> It looks like there has already been a bunch of activity around this
> question on the issue tracker.
>
> 1. The Reexport package already exists:
> https://github.com/simonster/Reexport.jl
> 2. There is an issue discussing adding `reexport/reexported` and
> `exportall` keywords: https://github.com/JuliaLang/julia/issues/1986
> 3. There is an open pull request to merge some of this functionality into
> Base: https://github.com/JuliaLang/julia/pull/5626
>

Reply via email to