Skip to content

Commit

Permalink
Document AbstractDict and AbstractSet
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt committed Feb 28, 2019
1 parent 215a5c9 commit af51890
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
13 changes: 13 additions & 0 deletions base/essentials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,20 @@ const Callable = Union{Function,Type}

const Bottom = Union{}

"""
AbstractSet{T}
Supertype for set-like types whose elements are of type `T`.
[`Set`](@ref), [`BitSet`](@ref) and other types are subtypes of this.
"""
abstract type AbstractSet{T} end

"""
AbstractDict{K, V}
Supertype for dictionary-like types with keys of type `K` and values of type `V`.
[`Dict`](@ref), [`IdDict`](@ref) and other types are subtypes of this.
"""
abstract type AbstractDict{K,V} end

# The real @inline macro is not available until after array.jl, so this
Expand Down
3 changes: 3 additions & 0 deletions doc/src/base/collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Fully implemented by:
* `Number`
* [`AbstractArray`](@ref)
* [`BitSet`](@ref)
* [`Dict`](@ref)
* [`IdDict`](@ref)
* [`Dict`](@ref)
* [`WeakKeyDict`](@ref)
Expand Down Expand Up @@ -191,6 +192,7 @@ for the key `x`). Multiple arguments to `D[...]` are converted to tuples; for e
`D[x,y]` is equivalent to `D[(x,y)]`, i.e. it refers to the value keyed by the tuple `(x,y)`.

```@docs
Base.AbstractDict
Base.Dict
Base.IdDict
Base.WeakKeyDict
Expand Down Expand Up @@ -233,6 +235,7 @@ Partially implemented by:
## Set-Like Collections

```@docs
Base.AbstractSet
Base.Set
Base.BitSet
Base.union
Expand Down
2 changes: 1 addition & 1 deletion doc/src/manual/conversion-and-promotion.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ already of the requested type:
convert(::Type{T}, x::T) where {T<:Number} = x
```

Similar definitions exist for `AbstractString`, `AbstractArray`, and `AbstractDict`.
Similar definitions exist for `AbstractString`, [`AbstractArray`](@ref), and [`AbstractDict`](@ref).

## Promotion

Expand Down

0 comments on commit af51890

Please sign in to comment.