Skip to content

Commit d6ef750

Browse files
include only works on global scope (#39317)
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).
1 parent 815076b commit d6ef750

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/src/manual/modules.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ end
2626

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

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

0 commit comments

Comments
 (0)