lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Has anyone done a generic, robust, copy on write table proxy?

Someone's asked for undo support for WordGrinder. Unfortunately I didn't
bake support for changelists into the design right at the very
beginning, and retrofitting the data model to support them would be way
too much work.

OTOH if I can efficiently snapshot the entire document state without
having to deep copy it, then I can keep the existing model and not have
to change the bulk of my code.

The document is stored as a deeply nested set of tables, using both
array and hash parts; it's just plain data with no metatable stuff involved.

(Incidentally, did I announce here that I recently released WordGrinder
0.4.1? Now with a proper Windows port and OpenDocument import/export.
And it's all MIT licensed, with lots of useful stuff to pull out and
steal: http://wordgrinder.sourceforge.net/)

-- 
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│
│ 𝕻𝖍'𝖓𝖌𝖑𝖚𝖎 𝖒𝖌𝖑𝖜'𝖓𝖆𝖋𝖍 𝕮𝖙𝖍𝖚𝖑𝖍𝖚 𝕽'𝖑𝖞𝖊𝖍
𝖜𝖌𝖆𝖍'𝖓𝖆𝖌𝖑 𝖋𝖍𝖙𝖆𝖌𝖓.
│

Attachment: signature.asc
Description: OpenPGP digital signature