Skip to content

Commit d4f7450

Browse files
author
Michael Abbott
committed
tweak docstring & error
1 parent d5670a4 commit d4f7450

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

base/abstractarray.jl

+10-9
Original file line numberDiff line numberDiff line change
@@ -1574,7 +1574,7 @@ function _typed_cat(::Type{T}, A::AbstractArray{<:AbstractArray}, valg::Val=Val(
15741574
for j in eachindex(A)
15751575
Aj = A[j]
15761576
if axes(Aj) != ax1
1577-
throw(ArgumentError("expected arrays of consistent size, got $(axes(Aj)) for argument $j, compared to $ax1 for the first"))
1577+
throw(ArgumentError("expected arrays of consistent size, got $(UnitRange.(axes(Aj))) for element $j, compared to $(UnitRange.(ax1)) for the first"))
15781578
end
15791579
dense &= isa(Aj, Array)
15801580
end
@@ -1847,20 +1847,21 @@ and `J in CartesianIndices(first(A))`.
18471847
!!! compat "Julia 1.6"
18481848
These methods require at least Julia 1.6.
18491849
1850+
# Examples
18501851
```jldoctest
1851-
julia> reduce(cat(dims=3), [ones(2,2), fill(√2,2,2), [4 8; 16 32]])
1852-
2×3 Array{Float64, 3}:
1852+
julia> reduce(cat(dims=3), [ones(2,4), fill(√2,2,4), [2 4 8 16; 32 64 128 256]])
1853+
4×3 Array{Float64, 3}:
18531854
[:, :, 1] =
1854-
1.0 1.0
1855-
1.0 1.0
1855+
1.0 1.0 1.0 1.0
1856+
1.0 1.0 1.0 1.0
18561857
18571858
[:, :, 2] =
1858-
1.41421 1.41421
1859-
1.41421 1.41421
1859+
1.41421 1.41421 1.41421 1.41421
1860+
1.41421 1.41421 1.41421 1.41421
18601861
18611862
[:, :, 3] =
1862-
4.0 8.0
1863-
16.0 32.0
1863+
2.0 4.0 8.0 16.0
1864+
32.0 64.0 128.0 256.0
18641865
18651866
julia> reduce(cat(dims=4), [ones(2,3) for _ in 1:5]) |> size
18661867
(2, 3, 1, 5)

0 commit comments

Comments
 (0)