Last active
May 23, 2016 22:08
-
-
Save sglyon/8f1070e33b2cee730aa3b538a266cba2 to your computer and use it in GitHub Desktop.
julia relative modules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module ModA | |
| include("MyTypes.jl") | |
| using .MyTypes | |
| type A <: TheParent | |
| x::Int | |
| end | |
| end # module |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| foo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| include("a.jl") | |
| include("b.jl") | |
| display(ModA.A(1)) | |
| display(ModB.B(1)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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