"Kirill M. Katsnelson" <kkm(a)kis.ru> writes:
Some time ago, Olivier Galibert wrote...
| 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)
| (setq nbar (symbol-name 'bar))
| (aset nbar 0 ?x)
| --> 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.
(copy-sequence) is the function you are looking for.
So, IMO the correct behavior in your sample would be that aset signals;
although if you write (setq nbar (copy-sequence (symbol-name 'bar))) it
is ok, as it mangles with a copy of the string.
This is totally bogus behaviour. We should be returning a duplicate copy
of the string to begin with. Unless we make this do the 'right thing' and
reintern 'bar' as 'xar', which would be an even bigger crock.