emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why isn't the string returned by symbol-name read-only?


From: Daniel Colascione
Subject: Why isn't the string returned by symbol-name read-only?
Date: Sat, 23 Jan 2010 15:55:44 -0500
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Consider

(let ((name (symbol-name 'foo)))
  (aset name 0 ?x)
  (cons name (symbol-name 'foo)))

That yields ("xoo" . " xoo")

Now try


(let ((name (symbol-name 'car)))
  (aset name 0 ?x)
  (cons name (symbol-name 'car)))

That returns in an error when you try to evaluate it. The object
returned by (symbol-name 'car) must have some read-only bit set.

Why isn't that bit set for *all* symbol names?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)

iEYEARECAAYFAktbYlAACgkQ17c2LVA10VsTLQCcCjDdAU9NSvOAVEMmVHfyhXxp
PRMAmgPmovQuhwTUwKGIFvd5giGQyXy4
=6FHg
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]