@@ -286,7 +286,6 @@ function show_nd(io::IO, a::AbstractArray, print_matrix::Function, label_slices:
286286 @goto skip
287287 end
288288 end
289- # println(io, idxs)
290289 print (io, " ...\n\n " )
291290 @goto skip
292291 end
@@ -297,9 +296,7 @@ function show_nd(io::IO, a::AbstractArray, print_matrix::Function, label_slices:
297296 end
298297 end
299298 if label_slices
300- print (io, " [:, :, " )
301- for i = 1 : (nd- 1 ); print (io, " $(idxs[i]) , " ); end
302- println (io, idxs[end ], " ] =" )
299+ _show_nd_label (io, a, idxs)
303300 end
304301 slice = view (a, axes (a,1 ), axes (a,2 ), idxs... )
305302 print_matrix (io, slice)
@@ -308,6 +305,14 @@ function show_nd(io::IO, a::AbstractArray, print_matrix::Function, label_slices:
308305 end
309306end
310307
308+ function _show_nd_label (io:: IO , a:: AbstractArray , idxs)
309+ print (io, " [:, :, " )
310+ for i = 1 : length (idxs)- 1
311+ print (io, idxs[i], " , " )
312+ end
313+ println (io, idxs[end ], " ] =" )
314+ end
315+
311316# print_array: main helper functions for show(io, text/plain, array)
312317# typeinfo agnostic
313318# Note that this is for showing the content inside the array, and for `MIME"text/plain".
0 commit comments