Some time ago, Olivier Galibert wrote...
|+
| On Fri, May 01, 1998 at 12:29:42AM -0700, Ben Wing wrote:
| > In the specifier code and in a lot of other code that I wrote, I had to
| > copy internal lists whenever they were returned just to make sure that
| > malicious code couldn't mess things up by modifying them. This is
| > inefficient, and could be avoided if we had read-only lists. The same
| > thing goes for strings, although they aren't generally copied.
|
| What do you want exactly, read-only or copy-on-write ?
|-
I haven't been thinking yet about what could COW buy us. But it looks very
hard to implement it, because if an object (say cons) is modified, all
pointers to it have to be adjusted, like
; a is a read-only cons (1 . 2)
(setq b a)
(setcar a 3)
; Now both a and b must point to the same copied rw cons (3 . 2)
Kirill