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.
Kyle Jones wrote:
Ben Wing writes:
> [...] For that matter, there would be no need to call copy-tree
> at all if it were possible to mark conses and vectors (and
> strings) as read-only. This should be possible using minimal
> tag bits, and I think it would be a great feature to add as it
> would eliminate a lot of other places where lists are copied
> solely to avoid possible malicious code modifying them. Kyle?
I have no idea what this is all about, but it is possible. With
USE_INDEXED_LRECORD_IMPLEMENTATION, there is room in the lrecord
header for property bits. Checks for the read-only bit would be
in the same places that CHECK_IMPURE is used now.
--
This message composed using voice recognition software and foot pedals.
(No keyboards were harmed while composing this message.)