From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: bool-vector implementation in the Emacs core Date: Fri, 23 Jan 2004 09:37:36 +0900 (JST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200401230037.JAA02124@etlken.m17n.org> References: <4nd69dfdn2.fsf@collins.bwh.harvard.edu> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1074818471 18234 80.91.224.253 (23 Jan 2004 00:41:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 23 Jan 2004 00:41:11 +0000 (UTC) Cc: tzz@lifelogs.com, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Jan 23 01:41:06 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 1AjpNi-0002Dd-00 for ; Fri, 23 Jan 2004 01:41:06 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AjpNh-0007Do-00 for ; Fri, 23 Jan 2004 01:41:05 +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 1AjpLg-0007YC-Bb for emacs-devel@quimby.gnus.org; Thu, 22 Jan 2004 19:39:00 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AjpL3-0007TM-RT for emacs-devel@gnu.org; Thu, 22 Jan 2004 19:38:21 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AjpKU-0007Gq-MC for emacs-devel@gnu.org; Thu, 22 Jan 2004 19:38:19 -0500 Original-Received: from [192.47.44.130] (helo=tsukuba.m17n.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AjpKT-0007G3-NN for emacs-devel@gnu.org; Thu, 22 Jan 2004 19:37:46 -0500 Original-Received: from fs.m17n.org (fs.m17n.org [192.47.44.2]) by tsukuba.m17n.org (8.11.6p2/3.7W-20010518204228) with ESMTP id i0N0bbh04259; Fri, 23 Jan 2004 09:37:37 +0900 (JST) (envelope-from handa@m17n.org) Original-Received: from etlken.m17n.org (etlken.m17n.org [192.47.44.125]) by fs.m17n.org (8.11.6p2/3.7W-20010823150639) with ESMTP id i0N0bac12859; Fri, 23 Jan 2004 09:37:36 +0900 (JST) Original-Received: (from handa@localhost) by etlken.m17n.org (8.8.8+Sun/3.7W-2001040620) id JAA02124; Fri, 23 Jan 2004 09:37:36 +0900 (JST) Original-To: no-spam@cua.dk In-reply-to: (no-spam@cua.dk) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.3 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI) 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:19446 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:19446 In article , no-spam@cua.dk (Kim F. Storm) writes: >> 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? I'm not sure. Emacs-unicode uses char-table for many things. It is a pseudo array of 0..#x3FFFFF. So, if indices fit in this range, you can use it not only for a character, but for any integer. Ex. Set `t' to these ranges: (1 (6 . 8) 1000 (1500 . 1600) 2000) (setq tbl (make-char-table nil)) (aset tbl 1 t) (set-char-table-range tbl '(6 . 8) t) (aset tbl 1000 t) (set-char-table-range tbl '(1500 . 1600) t) (aset tbl 2000 t) It may consume more memory than ranges or inversion list, (aref tbl N) is quite faster than them. It is also possible to implement a code that doesn't limit the range to 0..#x3fffff if it is really required. --- Ken'ichi HANDA handa@m17n.org