@@ -286,7 +286,6 @@ function show_nd(io::IO, a::AbstractArray, print_matrix::Function, label_slices:
286
286
@goto skip
287
287
end
288
288
end
289
- # println(io, idxs)
290
289
print (io, " ...\n\n " )
291
290
@goto skip
292
291
end
@@ -297,9 +296,7 @@ function show_nd(io::IO, a::AbstractArray, print_matrix::Function, label_slices:
297
296
end
298
297
end
299
298
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)
303
300
end
304
301
slice = view (a, axes (a,1 ), axes (a,2 ), idxs... )
305
302
print_matrix (io, slice)
@@ -308,6 +305,14 @@ function show_nd(io::IO, a::AbstractArray, print_matrix::Function, label_slices:
308
305
end
309
306
end
310
307
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
+
311
316
# print_array: main helper functions for show(io, text/plain, array)
312
317
# typeinfo agnostic
313
318
# Note that this is for showing the content inside the array, and for `MIME"text/plain".
0 commit comments