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 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
statement if you want to use the packages names without qualifying them.
See here for some more detailed examples.
4 days ago