Since range and array are more or less interchangeable computationally (but 
not memory-wise), I suspect the main issue is how a range object should be 
reported in the REPL. Julia REPL already tries to be smart about reporting 
an array, either listing out all the elements or showing the beginning and 
end with ellipsis in between. Perhaps it would be helpful to do something 
like this:

julia> linspace(0,10,1000)
1001-element Range{Float64,1}:
0.0
0.1
...
10.0  

Or some such; it's probably wrong to express Range as a container like 
Array. But idea is that in the REPL, when someone queries a range or array, 
they probably want to see what's in it, because they want to verify whether 
the generator does what they intended. So it would help to inform the user 
that the object is indeed a range, the type it contains, and a summary of 
the actual values therein. 


On Wednesday, September 30, 2015 at 2:51:46 PM UTC-4, Christoph Ortner 
wrote:
>
> I, on the other hand, don't understand the obsession with abstraction.
>
> Also, by your argument the following should all be special types rather 
> than box-standard arrays. 
>
> julia> typeof(ones(10))
> Array{Float64,1}
>
> julia> typeof(zeros(10))
> Array{Float64,1}
>
> julia> typeof(eye(10))
> Array{Float64,2}
>
>
>
>
>

Reply via email to