dummy-link

Requires

Lazy code loading for Julia

Readme

Note: changes in v0.7

Requires now needs a UUID, and must be called from within your packages __init__ function. For example:

function __init__()
    @require JSON="682c06a0-de6a-54ab-a142-c8b1cf79cde6" do_stuff()
end

Requires.jl

Build Status

Requires is a Julia package that will magically make loading packages faster, maybe. It supports specifying glue code in packages which will load automatically when a another package is loaded, so that explicit dependencies (and long load times) can be avoided.

Usage is as simple as

media(::MyType) = Textual()

@require Gadfly begin
  media(::Gadfly.Plot) = Graphical()
end

For larger amounts of code you can also use @require Package include("glue.jl"). The code wrapped by @require will execute as soon as the given package is loaded (which may be immediately).

julia> using Requires

julia> @require DataFrames println("foo")

julia> using DataFrames
foo

julia> @require DataFrames println("bar")
bar

Note that the package is not imported by default – you need an explicit using statement if you want to use the packages names without qualifying them.

See here for some more detailed examples.

First Commit

12/24/2014

Last Touched

4 days ago

Commits

67 commits

Requires: