Skip to content

Instantly share code, notes, and snippets.

@sglyon
Last active May 23, 2016 22:08
Show Gist options
  • Select an option

  • Save sglyon/8f1070e33b2cee730aa3b538a266cba2 to your computer and use it in GitHub Desktop.

Select an option

Save sglyon/8f1070e33b2cee730aa3b538a266cba2 to your computer and use it in GitHub Desktop.
julia relative modules
module ModA
include("MyTypes.jl")
using .MyTypes
type A <: TheParent
x::Int
end
end # module
module ModB
include("MyTypes.jl")
using .MyTypes
type B <: TheParent
x::Int
end
Base.show(io::IO, x::B) = println(io, "I'm a B")
end # module
include("a.jl")
include("b.jl")
display(ModA.A(1))
display(ModB.B(1))
module MyTypes
export TheParent
abstract TheParent
Base.show(io::IO, p::TheParent) = println(io, "Some instance of TheParent")
end # module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment