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

docstrings for Base, Core, Main, Module #31131

Merged
merged 4 commits into from
Mar 3, 2019
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
39 changes: 33 additions & 6 deletions base/docs/basedocs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -2052,11 +2052,6 @@ See the manual section on [Tuple Types](@ref).
"""
Tuple

"""
The base library of Julia.
"""
kw"Base"

"""
typeassert(x, type)

Expand Down Expand Up @@ -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
11 changes: 9 additions & 2 deletions doc/src/base/base.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,15 @@ where
=
```

## Base Modules
## Standard Modules
```@docs
Main
Core
Base
```

## Base Submodules
```@docs
Base.Base
Base.Broadcast
Base.Docs
Base.Iterators
Expand Down Expand Up @@ -211,6 +217,7 @@ Base.Enums.@enum
Core.Expr
Core.Symbol
Core.Symbol(x...)
Core.Module
```

## Generic Functions
Expand Down
15 changes: 4 additions & 11 deletions doc/src/manual/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down