From 3bf75e620abb7598b4e98d701f935aa794218714 Mon Sep 17 00:00:00 2001 From: Matt Bauman Date: Wed, 11 Jan 2017 16:04:51 -0600 Subject: [PATCH] Add Colon to stdlib; touch up its doc --- base/essentials.jl | 5 +++-- doc/src/stdlib/arrays.md | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/base/essentials.jl b/base/essentials.jl index f858f336b7822..56490c1c469cf 100644 --- a/base/essentials.jl +++ b/base/essentials.jl @@ -229,13 +229,14 @@ function isassigned(v::SimpleVector, i::Int) return x != C_NULL end -# index colon """ Colon() Colons (:) are used to signify indexing entire objects or dimensions at once. + Very few operations are defined on Colons directly; instead they are converted -to `Slice`s upon indexing (within `to_indices`). +by `to_indices` to an internal vector type (`Base.Slice`) to represent the +collection of indices they span before being used. """ immutable Colon end diff --git a/doc/src/stdlib/arrays.md b/doc/src/stdlib/arrays.md index f19dd0be73630..7a49e7e5ebac3 100644 --- a/doc/src/stdlib/arrays.md +++ b/doc/src/stdlib/arrays.md @@ -57,6 +57,7 @@ Base.getindex(::AbstractArray, ::Any...) Base.view Base.@view Base.to_indices +Base.Colon Base.parent Base.parentindexes Base.slicedim