I've coded up a simple replacement to the show() function for ranges. The 
idea is to give the user information more likely to be what they are 
wondering. Here are some examples of its output:

*julia> **0:4*

*5-element UnitRange{Int64}:*

*0,1,2,3,4*


*julia> **0:10*

*11-element UnitRange{Int64}:*

*0,1,2,…,9,10*


*julia> **0:2:20*

*11-element StepRange{Int64,Int64}:*

*0,2,4,…,18,20*


*julia> **linspace(0,4,7)*

*7-element LinSpace{Float64}:*

*0.0,0.666667,1.33333,…,3.33333,4.0*


Any thoughts on this arrangement? The output differs from collect() in that 
I've arranged elements in a compact row. Also I've assumed that it's 
sufficient to print out only the first three elements, and the last two, 
because the user should be able to figure it out from there. A possible 
point of confusion is "7-element" which isn't actually true of the Range 
object. Would it be better to output "7-length" or something else?

Reply via email to