Re: Design Notes -- Piece Tables

John Brewer (
Fri, 28 Aug 1998 01:09:20 -0700

Actually, I was surprised to see you were using a buffer gap in the first
place. As far as I know, all modern word processors use piece tables.

The downside is that the bookkeeping can be horrendous. Not so much in
terms of speed or space, but understanding what's going on, and tracing
through the data structures when things go wrong. Some well-placed
instrumentation is probably in order.

It might make sense to use multiple buffers, say one per paragraph or
section, so that data paths don't get too random.

One of the coolest uses of piece tables I've seen was in WriteNow. When
you saved a document, by default it kept the piece tables for the previous
revision around, so you could essentially undo one "Save" operation. (I
believe they called it "Revert to Backup", as opposed to "Revert to Saved).

Good stuff,

John Brewer
Jera Design

Double-click anywhere with JarRunner!

This archive was generated by hypermail 1.03b2.