guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vectors are something else


From: Mark H Weaver
Subject: Re: vectors are something else
Date: Fri, 12 Apr 2013 17:43:14 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Daniel Hartwig <address@hidden> writes:

> On 12 April 2013 15:23, Daniel Llorens <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]