unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: bool-vector implementation in the Emacs core
Date: Sat, 24 Jan 2004 21:59:50 -0500	[thread overview]
Message-ID: <4n4qukg2c9.fsf@collins.bwh.harvard.edu> (raw)
In-Reply-To: E1AkVVb-0000B7-C3@fencepost.gnu.org

On Sat, 24 Jan 2004, rms@gnu.org wrote:

> Why not just write code to use such a list explicitly?

I can write it myself in ELisp (the code is very simple), but I had
two reasons for bringing it up on emacs-devel:

- I think other Emacs developers could benefit from the same code.
  Inversion lists are very fast in most cases, and for sparse ranges
  are significantly faster and use less memory than the current
  implementation of bool-vector (which is basically a bitstring).

- I thought that a straight C implementation might be even better
  than using ELisp primitives; it's best to ask that question of the
  Emacs developers since I'm not familiar with the Emacs internals.

> Why do you need it to be hidden inside of a bool-vector?

Because the aref/aset API of bool-vector is nice, and existing code
that uses bool-vector can use inversion lists without major changes.

Also, bool-vector is definitely the right abstraction for what
inversion lists do.  There's no need to invent a new data type, with a
new API, for basically a bool-vector with an alternate internal
representation.

You can specify hashtable size when you create it.  In the same way
you could specify the bool-vector preference to be 'dense or 'sparse
for the range.  Then Emacs would give you an inversion list for sparse
ranges or a bitstring for dense ranges.  That's what I was really
hoping for.

Thank you
Ted

  reply	other threads:[~2004-01-25  2:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-21 16:52 bool-vector implementation in the Emacs core Ted Zlatanov
2004-01-21 17:06 ` Paul Jarc
2004-01-21 18:35   ` Ted Zlatanov
2004-01-23  0:16 ` Kim F. Storm
2004-01-23  0:37   ` Kenichi Handa
2004-01-23  2:19     ` Stefan Monnier
2004-01-23 20:26     ` Ted Zlatanov
2004-01-24 21:40       ` Richard Stallman
2004-01-25  2:59         ` Ted Zlatanov [this message]
2004-01-26 19:23           ` Richard Stallman
2004-01-27  1:32             ` Kim F. Storm
2004-01-23 20:18   ` Ted Zlatanov
2004-01-24  2:11     ` Kim F. Storm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4n4qukg2c9.fsf@collins.bwh.harvard.edu \
    --to=tzz@lifelogs.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).