3. 專案的長相
<project name>/
src/: source code
test/: test code
appveyor.yml
LICENSE.md
README.md
REQUIRE: the requirement modules, including the Julia version (necessary)
9. Source code
src/
Foo.jl
bar1.jl
bar2.jl
…
__precompile__()
module Foo
using ……
import ……
export <lots of functionalities>
include(“bar1.jl")
include(“bar2.jl")
end
10. Test code
test/
runtests.jl
bar1.jl
bar2.jl
…
using Foo
using Base.Test
tests = [“bar1",
“bar2"]
println("Running tests:")
for t in tests
println(" * $(t)")
include("$(t).jl")
end
15. Example
#
# Subject
#
immutable Subject <: Functor
value
end
function get(subject::Subject)
return subject.value
end
function init_task(f::Function, args::Vararg)
x = @task f(args...)
consume(x)
return x
end