Chris Bitmead uid(x22068)
Mon, 12 May 1997 13:39:46 +1000
>> > I've got in mind a function (chapter-edit) which takes a "Chapter" as
>> > argument and returns a new Chapter object as a result. The old version
>> > is not changed in true functional style. Another function (book-edit)
>> > takes a "Book" object as argument, and then calls (chapter-edit) to
>> > modify chapters. Instead of modifying the book object, (book-edit)
>> > makes a new book with the all the latest versions of the chapters and
>> > returns the new book object. The old version of the book object is
>> > left as-is. (In functional style)
>Probably easier to make a copy of the chapter, destructively modify
>the original to contain the new data, and then have a link to the
>previous version. Otherwise you're restricted to accessing the current
>version of the book via some kind of registry or other.
That's not necessarily what you want. You might have other documents
which have a link to your document that don't want to assume the
latest version. They are interested in version 1.4.7, which they have
a reference to.
If you want the latest version you should have to ask the
"Treasure Island"). The latest version is an abstract notion, and
it is not appropriate to use a direct reference.
Destructive anything, is in general a bad idea.