Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mention use of underscore for private fields in manual #40131

Merged
merged 3 commits into from
Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/src/manual/style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ uses (e.g. `a[i]::Int`) than to try to pack many alternatives into one type.
words squashed together ([`isequal`](@ref), [`haskey`](@ref)). When necessary, use underscores
as word separators. Underscores are also used to indicate a combination of concepts ([`remotecall_fetch`](@ref)
as a more efficient implementation of `fetch(remotecall(...))`) or as modifiers.
* functions mutating at least one of their arguments end in `!`.
* use identifiers starting with `_` to
denote functions, macros or variables that should be considered private and not part of a package's
public API.
* conciseness is valued, but avoid abbreviation ([`indexin`](@ref) rather than `indxin`) as
it becomes difficult to remember whether and how particular words are abbreviated.

Expand Down
2 changes: 2 additions & 0 deletions doc/src/manual/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,7 @@ conventions:
* Functions that write to their arguments have names that end in `!`. These are sometimes called
"mutating" or "in-place" functions because they are intended to produce changes in their arguments
after the function is called, not just return a value.
* Names starting with an underscore denote functions, macros or variables that are only used internally
by a package and are not part of its public API.

For more information about stylistic conventions, see the [Style Guide](@ref).