emacs-devel
[Top][All Lists]
Advanced

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

Re: Set operations on bool-vectors


From: Stefan Monnier
Subject: Re: Set operations on bool-vectors
Date: Sat, 21 Sep 2013 11:51:34 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> 2013-09-21  Daniel Colascione  <address@hidden>

>       * alloc.c (bool_vector_payload_bytes): New function: computes
>       rounded-up payload size for a bool vector.  Always allocate
>       at least size_t bytes even for a zero-size vector.

That should just be "New function" and the rest should be moved to
a comment in the C code.

>       (Fmake_bool_vector): Instead of calling Fmake_vector,
>       which performs redundant initialization and argument checking,
>       just call allocate_vector ourselves.  Make sure we clear any
>       terminating padding to zero.

Good.  So the functional change is to set the padding to zero.

>       (vector_nbytes,sweep_vectors): Use bool_vector_payload_bytes
>       instead of open-coding the size calculation.

OK that makes sense, thank you.

>>> +       doc: /* Compute A = B ^ C, bitwise exclusive or.
>> Why not make it C = A ^ B and then make C optional?
>> Same for other similar functions: make the destination argument optional.
> Then we wouldn't be able to extend these functions to accept more than
> three arguments: we wouldn't know whether the argument at the end was
> another operand or a destination.

Sounds like a minor potential inconvenience in exchange for a much
cleaner interface.


        Stefan



reply via email to

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