You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For older versions of Julia, see https://github.com/MikeInnes/Requires.jl/blob/5683745f03cbea41f6f053182461173e236fdd94/README.md
10
4
11
5
# Requires.jl
12
6
@@ -17,34 +11,85 @@ faster, maybe. It supports specifying glue code in packages which will
17
11
load automatically when a another package is loaded, so that explicit
18
12
dependencies (and long load times) can be avoided.
19
13
20
-
Usage is as simple as
14
+
Suppose you've written a package called `MyPkg`. `MyPkg` has core functionality that it always provides;
15
+
but suppose you want to provide additional functionality if the `Gadfly` package is also loaded.
16
+
Requires.jl exports a macro, `@require`, that allows you to specify that some code is conditional on having both packages available.
17
+
18
+
`@require` must be within the [`__init__`](https://docs.julialang.org/en/v1/manual/modules/#Module-initialization-and-precompilation-1) method for your module.
19
+
Here's an example that will create a new method of a function called `myfunction` only when both packages are present:
0 commit comments