On Fri, May 01, 1998 at 08:33:01PM +0200, Hrvoje Niksic wrote:
> 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.
With the indexed lrecord implementation, it is quite easy to do. But
I'm not convinced this is what you really want to have:
(setq bar 10)
10
(setq nbar (symbol-name 'bar))
"bar"
(aset nbar 0 ?x)
?x
nbar
"xar"
bar
--> Symbol's value as variable is void: bar
How am I supposed to work on the string which happens to be initially
a symbol name ? I see no "copy-string" or equivalent function.
Maybe the answer is "it is broken now, it will only detect bugs" :-)
OG.