https://github.com/JuliaLang/julia
Revision 9e09f70e94dbfb37b3b909109ed961811aa51671 authored by Tamas K. Papp on 05 November 2020, 21:09:45 UTC, committed by GitHub on 05 November 2020, 21:09:45 UTC
* Reorganize the Modules chapter of the manual.

Main changes

Namespaces, export, import, using

- explain namespaces, qualified symbol names, and export lists
- consolidate examples where applicable
- fix examples which were outdated after #25306
- distribute the “Namespace miscellanea” section into parts in the appropriate sections
- break up the summary table and explain each case in detail with examples
- subsection on various strategies to handle symbol conflicts
- use “bring into the namespace/scope” instead of “import” in the text, as readers confuse it with `import`
- explicitly document what happens with multiple `using` / `import` statements
- add relevant style / best practices suggestions which are now widely used in the Julia ecosystem

Submodules

- discuss usage of `using ParentModule.SubModule` etc (relies on code loading)
- add submodule examples where order matters, fixes #38011 (also another example by @rdeits [from Discourse](https://discourse.julialang.org/t/problem-with-using-in-submodules/42321/2))
- mention that submodules do not “inherit” scope from parent

Misc incidental changes

- in the Methods chapter, add a note about adding methods to functions in other modules
- add a markdown id to the code-loading chapter

The “Module initialization and precompilation” section is left unchanged.

Co-authored-by: Tim Holy <tim.holy@gmail.com>
Co-authored-by: Simon Byrne <simonbyrne@gmail.com>
1 parent 8ca5b94
History
Tip revision: 9e09f70e94dbfb37b3b909109ed961811aa51671 authored by Tamas K. Papp on 05 November 2020, 21:09:45 UTC
Reorganize the Modules chapter of the manual. (#38271)
Tip revision: 9e09f70
File Mode Size
.devcontainer
base
cli
contrib
deps
doc
etc
src
stdlib
test
.clang-format -rw-r--r-- 3.3 KB
.gitattributes -rw-r--r-- 65 bytes
.gitignore -rw-r--r-- 273 bytes
.mailmap -rw-r--r-- 11.0 KB
CITATION.bib -rw-r--r-- 2.6 KB
CONTRIBUTING.md -rw-r--r-- 19.9 KB
HISTORY.md -rw-r--r-- 292.0 KB
LICENSE.md -rw-r--r-- 5.0 KB
Make.inc -rw-r--r-- 47.5 KB
Makefile -rw-r--r-- 27.5 KB
NEWS.md -rw-r--r-- 17.7 KB
README.md -rw-r--r-- 6.9 KB
VERSION -rw-r--r-- 10 bytes
sysimage.mk -rw-r--r-- 3.9 KB

README.md

back to top