Olivier Galibert <galibert(a)pobox.com> writes:
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 ?
Read-only.
(prog1 'bar
(aset (symbol-name 'bar) 0 ?x))
=> xar
Or:
(setq bar 10)
=> 10
(aset (symbol-name 'bar) 0 ?x)
=> ?x
bar
--> Symbol's value as variable is void: bar
In both cases, `aset' should have signaled an error.
--
Hrvoje Niksic <hniksic(a)srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
Reporter: Mr Gandhi, what do you think of Western Civilization?
Gandhi: I think it would be a good idea.