JuliaArrays / ArrayViews.jl

A Julia package to explore a new system of array views
MIT License
19 stars 18 forks source link

Remove some {T}s from type definitions #17

Closed andreasnoack closed 10 years ago

andreasnoack commented 10 years ago

@lindahua These {T}s have actually just been ignored by Julia until today's push of the call overload branch.

ivarne commented 10 years ago

Couldn't this rather be written as

immutable ContiguousView{T,N} <: ArrayView{T,N,N}
     arr::Array{T}
...

or is there a subtle difference between the two expressions?

andreasnoack commented 10 years ago

I don't think so, because Array{T} is not concrete so I think you'd get a less efficient solution. You couldn't do Array{T,N} either, because

julia> view(randn(4,4), :, 1)
4-element ContiguousView{Float64,1,Array{Float64,2}}:
  0.621978
  1.14273 
 -0.30176 
 -0.378925
ivarne commented 10 years ago

Thanks! It makes sense when you say it. It's way to easy to forget that Array{T} is abstract.

Keno commented 10 years ago

bump

lindahua commented 10 years ago

Already done in 3346c76.