From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Set operations on bool-vectors Date: Sat, 21 Sep 2013 11:51:34 -0400 Message-ID: References: <523CD363.6020400@dancol.org> <523D0814.5010806@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1379778711 10137 80.91.229.3 (21 Sep 2013 15:51:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Sep 2013 15:51:51 +0000 (UTC) Cc: Emacs development discussions To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 21 17:51:52 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VNPTM-0001RR-IC for ged-emacs-devel@m.gmane.org; Sat, 21 Sep 2013 17:51:52 +0200 Original-Received: from localhost ([::1]:60594 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNPTM-000065-7S for ged-emacs-devel@m.gmane.org; Sat, 21 Sep 2013 11:51:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNPTC-000060-SQ for emacs-devel@gnu.org; Sat, 21 Sep 2013 11:51:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VNPT6-0002ot-97 for emacs-devel@gnu.org; Sat, 21 Sep 2013 11:51:42 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:45006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNPT6-0002of-4Y for emacs-devel@gnu.org; Sat, 21 Sep 2013 11:51:36 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFsoXM0/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJBOICwbBLZEKA6R6gV6DEw X-IPAS-Result: Av4EABK/CFFsoXM0/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJBOICwbBLZEKA6R6gV6DEw X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="28577151" Original-Received: from 108-161-115-52.dsl.teksavvy.com (HELO pastel.home) ([108.161.115.52]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 21 Sep 2013 11:47:33 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 869BD63260; Sat, 21 Sep 2013 11:51:34 -0400 (EDT) In-Reply-To: <523D0814.5010806@dancol.org> (Daniel Colascione's message of "Fri, 20 Sep 2013 19:44:36 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:163537 Archived-At: > 2013-09-21 Daniel Colascione > * 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