Design choice for printing strings in Arrays


#1

I run up in an odd way of printing strings (compared to numbers per say) in a Vector.

julia> [1, 2.9,"test", 3, "test2"]
5-element Array{Any,1}:
 1
 2.9
  "test"
 3
  "test2"

Why is there a space before each string only ? Is it on purpose for readability in printing Arrays of strings ?

If there is no reason, I propose we make it coherent with the rest.


#2

This is due to julia having an “alignment” concept essentially for printing numbers aligned to the decimal point, or e.g. pairs aligned to their arrows; but this doesn’t play so well for heterogeneous arrays, as the array has only one such vertical line for alignment. This is not specific to strings by the way, e.g. printing a custom object without a specialized show will also be aligned like strings (i.e. aligned to the decimal point). But I agree it would be nicer to left-align those.