`include` calls in a Julia package

One common way is to write MyPkg.jl like so:


# External packages used anywhere
using Arrow
using DataFrames

#exports
export function1
export function2

# Internal files
include("A.jl")
include("B.jl")

Since A.jl will already have been included, B.jl will have access to its code. So you don’t need to worry about reimporting A in B.

5 Likes