diff --git a/base/docs/basedocs.jl b/base/docs/basedocs.jl index c92243dd87542..4549c098438d1 100644 --- a/base/docs/basedocs.jl +++ b/base/docs/basedocs.jl @@ -75,7 +75,7 @@ kw"abstract type" """ module -`module` declares a `Module`, which is a separate global variable workspace. Within a +`module` declares a [`Module`](@ref), which is a separate global variable workspace. Within a module, you can control which names from other modules are visible (via importing), and specify which of your names are intended to be public (via exporting). Modules allow you to create top-level definitions without worrying about name conflicts @@ -2052,11 +2052,6 @@ See the manual section on [Tuple Types](@ref). """ Tuple -""" -The base library of Julia. -""" -kw"Base" - """ typeassert(x, type) @@ -2151,4 +2146,36 @@ Union type of [`StridedVector`](@ref) and [`StridedMatrix`](@ref) with elements """ StridedVecOrMat +""" + Module + +A `Module` is a separate global variable workspace. See [`module`](@ref) and the [manual section about modules](@ref modules) for details. +""" +Module + +""" + Core + +`Core` is the module that contains all identifiers considered "built in" to the language, i.e. part of the core language and not libraries. Every module implicitly specifies `using Core`, since you can't do anything without those definitions. +""" +Core.Core + +""" + Main + +`Main` is the top-level module, and Julia starts with `Main` set as the current module. Variables defined at the prompt go in `Main`, and `varinfo` lists variables in `Main`. +```jldoctest +julia> @__MODULE__ +Main +``` +""" +Main.Main + +""" + Base + +The base library of Julia. `Base` is a module that contains basic functionality (the contents of `base/`). All modules implicitly contain `using Base`, since this is needed in the vast majority of cases. +""" +Base.Base + end diff --git a/doc/src/base/base.md b/doc/src/base/base.md index 3a1df621f1bff..6d15600de6720 100644 --- a/doc/src/base/base.md +++ b/doc/src/base/base.md @@ -87,9 +87,15 @@ where = ``` -## Base Modules +## Standard Modules +```@docs +Main +Core +Base +``` + +## Base Submodules ```@docs -Base.Base Base.Broadcast Base.Docs Base.Iterators @@ -211,6 +217,7 @@ Base.Enums.@enum Core.Expr Core.Symbol Core.Symbol(x...) +Core.Module ``` ## Generic Functions diff --git a/doc/src/manual/modules.md b/doc/src/manual/modules.md index 16ebfdb1ac9dd..80f59fff0a7d2 100644 --- a/doc/src/manual/modules.md +++ b/doc/src/manual/modules.md @@ -117,17 +117,10 @@ end ### Standard modules -There are three important standard modules: `Main`, `Core`, and `Base`. - -`Main` is the top-level module, and Julia starts with `Main` set as the current module. Variables -defined at the prompt go in `Main`, and [`varinfo()`](@ref) lists variables in `Main`. - -`Core` contains all identifiers considered "built in" to the language, i.e. part of the core language -and not libraries. Every module implicitly specifies `using Core`, since you can't do anything -without those definitions. - -`Base` is a module that contains basic functionality (the contents of `base/`). All modules implicitly contain `using Base`, -since this is needed in the vast majority of cases. +There are three important standard modules: +* [`Core`](@ref) contains all functionality "built into" the language. +* [`Base`](@ref) contains basic functionality that is useful in almost all cases. +* [`Main`](@ref) is the top-level module and the current module, when Julia is started. ### Default top-level definitions and bare modules