From c9a12b987034fd8c498720b4570417364c6a51bf Mon Sep 17 00:00:00 2001 From: Mark Huang <32028289+Markhng@users.noreply.github.com> Date: Mon, 8 Feb 2021 00:54:49 +0800 Subject: [PATCH 1/2] improve first/last docstrings improve `first`/`last` docstrings to indicate that two new methods have been added since v1.6 (#34868) --- base/abstractarray.jl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/base/abstractarray.jl b/base/abstractarray.jl index 4326b999a6930..e6bd2372b9aa2 100644 --- a/base/abstractarray.jl +++ b/base/abstractarray.jl @@ -394,6 +394,9 @@ end Get the first `n` elements of the iterable collection `itr`, or fewer elements if `v` is not long enough. +!!! compat "Julia 1.6" + This method requires at least Julia 1.6. + # Examples ```jldoctest julia> first(["foo", "bar", "qux"], 2) @@ -439,6 +442,9 @@ last(a) = a[end] Get the last `n` elements of the iterable collection `itr`, or fewer elements if `v` is not long enough. +!!! compat "Julia 1.6" + This method requires at least Julia 1.6. + # Examples ```jldoctest julia> last(["foo", "bar", "qux"], 2) From c2b303229cc4a6a7cd5e94f5eae9e53d9e9a389a Mon Sep 17 00:00:00 2001 From: Mark Huang <32028289+Markhng@users.noreply.github.com> Date: Mon, 8 Feb 2021 09:41:57 +0800 Subject: [PATCH 2/2] Update abstractarray.jl remove the trailing whitespaces --- base/abstractarray.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/abstractarray.jl b/base/abstractarray.jl index e6bd2372b9aa2..a0e0f882a4f30 100644 --- a/base/abstractarray.jl +++ b/base/abstractarray.jl @@ -444,7 +444,7 @@ long enough. !!! compat "Julia 1.6" This method requires at least Julia 1.6. - + # Examples ```jldoctest julia> last(["foo", "bar", "qux"], 2)