Daniel Hartwig <mand...@gmail.com> writes: > On 12 April 2013 15:23, Daniel Llorens <daniel.llor...@bluewin.ch> wrote: >> >> However my proposal is also to produce the same type error when >> the argument is a rank-1 array with base!=0 or inc!=1. These >> may be indexed from 0, but can only be produced by using the >> array interface, and use the array implementation >> internally. > > I don't think this particular test is that useful, as it is too > concerned with the details of how the array indices map > to the underlying vector, rather than whether the array > indices themselves are compatible with the vector > indexing semantics. Too restrictive IMO, you may as > well just not permit any array passed to vector > interfaces.
I've not yet had time to carefully read this thread, but I wanted to say that I think we *should* prohibit passing arrays to the vector interfaces. When we have native code generation, then it will be possible to make the vector procedures extremely simple machine code sequences. We must avoid adding any complications to this. Even a single additional conditional branch will be painful, in both runtime overhead and code size. If we were to support a subset of arrays to the vector interface, the way it should be done is have the array constructors produce actual vector objects when possible, or at least something that can be used by the simple vector code sequences without any additional conditional branches. Does this make sense? Regards, Mark