I put up a simple demo that implements a piece table data structure in
Clojure

(This is totally an excuse to use finger trees, which Chris Houser
implemented and excellently presented at the first conj)

A piece table is good for buffer management in a text editor, as it
gets around making changes in place.  All changes are made to a
separate append-only buffer.

I'll spare you the details but if you look at the code you'll see why
a finger tree is a good base structure...
Each piece in the table has a different "weight" (the length of the
piece), and you need to find a point without traversing the whole
sequence.

https://github.com/ghadishayban/piece-table/blob/master/src/piecetable/core.clj

More about piece-tables
http://www.cs.unm.edu/~crowley/papers/sds.pdf

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to