May 2019
Beginner to intermediate
466 pages
10h 44m
English
Let's look at some examples that illustrate scoping rules when working with modules. Please open a new Julia REPL.
We've seen the using statement many times throughout the previous chapters, and now we understand its role—to bring another module and its definitions (variables, functions, types) into scope. Let's try it with our newly created modules:
julia> using Letters
ERROR: ArgumentError: Package Letters not found in current path:
- Run `Pkg.add("Letters")` to install the Letters package.
Ouch, an exception! Julia informs us that it doesn't know where to find the Letters module and advises us to use Pkg.add("Letters") to install it. But, since Pkg.add only works with registered packages and we haven't published ...
Read now
Unlock full access