all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Colascione <daniel@censorshipresearch.org>
To: Emacs development discussions <emacs-devel@gnu.org>
Subject: Why isn't the string returned by symbol-name read-only?
Date: Sat, 23 Jan 2010 15:55:44 -0500	[thread overview]
Message-ID: <4B5B6250.1080108@censorshipresearch.org> (raw)

-----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	other threads:[~2010-01-23 20:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-23 20:55 Daniel Colascione [this message]
2010-01-23 21:53 ` Why isn't the string returned by symbol-name read-only? Chong Yidong
2010-01-24  0:33 ` alin.s
2010-01-24  9:48   ` Thien-Thi Nguyen
2010-01-24  1:12 ` Davis Herring
2010-01-24 11:19   ` alin.s
2010-01-25  3:08 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B5B6250.1080108@censorshipresearch.org \
    --to=daniel@censorshipresearch.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.