Skip to content

Commit

Permalink
include only works on global scope (#39317)
Browse files Browse the repository at this point in the history
Just changed the ending of a phrase:

"`include` behaves as if the contents of the source file were evaluated in its place."

to

"`include` behaves as if the contents of the source file were evaluated in the global scope of the including module."

because I have already answered more than one person in Discourse trying to load variable definitions and code pieces from another file to inside a function scope (instead the global scope).
  • Loading branch information
henriquebecker91 authored Jan 19, 2021
1 parent 815076b commit d6ef750
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/src/manual/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ end

Files and file names are mostly unrelated to modules; modules are associated only with module
expressions. One can have multiple files per module, and multiple modules per file. `include`
behaves as if the contents of the source file were evaluated in its place. In this chapter, we use
short and simplified examples, so we won't use `include`.
behaves as if the contents of the source file were evaluated in the global scope of the
including module. In this chapter, we use short and simplified examples, so we won't use `include`.

The recommended style is not to indent the body of the module, since that would typically lead to
whole files being indented. Also, it is common to use `UpperCamelCase` for module names (just like
Expand Down

0 comments on commit d6ef750

Please sign in to comment.