Ivar, I like that idea. It would make it easier to use pointers for arrays.
Maybe there are caveats I haven't seen.

Regarding AbstractArray, I think the call to elsize serves as a correctness
check for that method.

2014-12-07 17:31 GMT-05:00 Ivar Nesje <[email protected]>:

> Seems to me like pointer(A, 3, 6) would be nice and unambiguous for 2d
> arrays. Is there any reason why that shouldn't be implemented?
>
> The current implementation is a little too dangerous for AbstractArray, in
> my opinion. Can we limit it to ContiguousArray (or whatever it is called
> now), and make it somewhat safer?
>
>
> https://github.com/JuliaLang/julia/blob/4b299c2fd5464ece308a8e708789a9d2aa9e32d3/base/pointer.jl#L29
>
> I know these questions is a better fit for github, but I don't have time
> to create a PR right now.

Reply via email to