It could be made shorter and extensions in implementations are welcome.
I think we are both correct. My approach is to think than one should program
with transactional states in my some kind of modal development practice that
allows to prepare for future needs.
Also, the sample implementation that is in-memory has some transaction semantic.
When the transaction starts it picks the last version of the database and apply
modification to that version, when the transaction commit the database is replaced
with the updated / improved version. It really works in single thread setting.
Even with this simplistic design handling transaction state, it allows during development
to climb the ladder of features, by being mindful of transaction from the start, to
move to persistent storage or in-memory multithread settings (that must be dealt with at
somepoint). Even if two transactions from different threads (or green threads?) modify
different part of the version, when one ends the transaction makes its version of reality
the truth globalizing possibly ignoring / overring / erase modification made by other
transactions. There is no locking or versioning involved per key-value pair. It is difficult
to explain.
functional store does not versions key-value pairs (I am thinking about a way to do
that but I might take a shortcut that the extra space required for the fractal composition
of abstractions e.g. a space filling curve inside the a 4-tuple store is a waste of space
because the space filling curve is query along a single subspace.))
I am not sure what are the consequences of using call/cc inside transaction. Actually,
I just never use call/cc in transactions. My plan was to not rely on green threads
for my application. But now that I think about it, I might need it.