From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: no-spam@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: bool-vector implementation in the Emacs core Date: 23 Jan 2004 01:16:04 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <4nd69dfdn2.fsf@collins.bwh.harvard.edu> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1074813680 7909 80.91.224.253 (22 Jan 2004 23:21:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 22 Jan 2004 23:21:20 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Jan 23 00:21:14 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Ajo8Q-00061d-00 for ; Fri, 23 Jan 2004 00:21:14 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Ajo8Q-0005YO-00 for ; Fri, 23 Jan 2004 00:21:14 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Ajo84-0004Zv-VZ for emacs-devel@quimby.gnus.org; Thu, 22 Jan 2004 18:20:52 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Ajo77-0004Kw-CU for emacs-devel@gnu.org; Thu, 22 Jan 2004 18:19:53 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Ajo4a-0003HJ-CB for emacs-devel@gnu.org; Thu, 22 Jan 2004 18:17:47 -0500 Original-Received: from [195.41.46.235] (helo=pfepa.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Ajo3i-000355-Io for emacs-devel@gnu.org; Thu, 22 Jan 2004 18:16:22 -0500 Original-Received: from kfs-l.imdomain.dk.cua.dk (0x503e2644.bynxx3.adsl-dhcp.tele.dk [80.62.38.68]) by pfepa.post.tele.dk (Postfix) with SMTP id E1E19480027; Fri, 23 Jan 2004 00:16:11 +0100 (CET) Original-To: Ted Zlatanov In-Reply-To: <4nd69dfdn2.fsf@collins.bwh.harvard.edu> Original-Lines: 38 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:19442 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:19442 Ted Zlatanov writes: > > We're talking about implementations of ranges in the Gnus developer > list right now, and our implementations of ranges is written in > Lisp. I can implement inversion lists in Lisp as well, but ranges > are such an essential Gnus piece that it seems like seeking core > support for them would be a good idea. What kind of C-level support are you looking for? If you implement inversion lists with lists, I don't really think lookups or inserts will be significantly faster in C than in byte-compiled Elisp. I do think that it would be a good idea to add the bool-vector support to the emacs lisp core files though, e.g. in subr.el. What kind of API do you envision? > > When dealing with vectors, we can preallocate a fixed number of slots > at the end of the vector to allow for growth or shrinkage of the > inversion list. The empty slots can be contain the repetition of > the last value, or 0 as an out-of-band value. I think a list-based > implementation is slightly better, though. IMO, vectors are the wrong tool for this kind of job -- lists are both faster and more flexible to use for inversion lists. > I did a search on this topic, but could not find anything. I hope my > proposal is of interest to people other than Gnus developers (Unicode > coders, for instance). It's a good question -- will unicode benefit from this at the C-level? -- Kim F. Storm http://www.cua.