unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu>
Cc: "Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu>,
	rms@gnu.org, emacs-devel@gnu.org
Subject: Re: emacs and guile (Re: ehelp woes, or why I hate a module that I love so much)
Date: Fri, 19 Jul 2002 09:34:22 -0400	[thread overview]
Message-ID: <200207191334.g6JDYMe15622@rum.cs.yale.edu> (raw)
In-Reply-To: tx1k7nrvpu0.fsf@raeburn.org

> > Actually, this is a recent change, right ?  In Emacs-21.2, `symbol-name'
> > always returns a string with no properties.  In that case we should
> > probably also strip the properties when we create a new symbol, instead
> > of wasting those intervals.
> 
> I don't know about 21.2, but it happens for me with:
>  21.1    - at work

Looks like I was wrong then.  Sorry.

> Are you sure about 21.2?  It would be odd for it to have been fixed
> there but not on the trunk.  Here's the whole thing I'm doing to
> reproduce it in ielm:
> 
>     ELISP> (setq s "booga-booga")
>     "booga-booga"
>     ELISP> (put-text-property 3 6 'some-prop 'some-val s)
>     nil
>     ELISP> (setq s2 (intern s))
>     booga-booga
>     ELISP> (symbol-name 'booga-booga)
>     #("booga-booga" 0 3 nil 3 6
>       (some-prop some-val)
>       6 11 nil)
> 
> I do think it makes sense for symbol-name's return value to have no
> text properties.

I agree, but I'm not sure it matters enough to change `intern's behavior.

> >> An Emacs Lisp symbol's name can also be changed after interning, such
> >> that it won't be found when interning either the old name or
> >> (probably) the new name.
> >
> > This is undocumented and I don't know of any code that relies on it
> > (well, I know of some such code, but not in any elisp package).
> > I think it should be considered as a misfeature/bug (but I don't
> > think it's worth fixing unless the fix is to make the output of
> > `symbol-name' be read-only).
> 
> Maybe if we had read-only strings....

My Emacs' strings are (mostly) read-only (as are its `defconst' variables).
It does introduce some breakage, but the use of `aset' on strings is
surprisingly infrequent.

> > I'm pretty sure that Scheme's symbol-name (if such a function exists)
> > returns a brand new string.
> 
> Which would be another difference -- retrieving the name twice would
> give two values not "eq?" while in Emacs Lisp they are "eq".  So is
> *that* property something that anyone might rely on in their Lisp code?

I don't think I've ever seen code rely on it, but I like it from
a performance point of view.


	Stefan

  reply	other threads:[~2002-07-19 13:34 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-25 14:50 ehelp woes, or why I hate a module that I love so much Juanma Barranquero
2002-06-25 15:06 ` D. Goel
2002-06-25 15:41   ` Juanma Barranquero
2002-06-26 22:24 ` Richard Stallman
2002-06-27 17:11   ` Juanma Barranquero
2002-06-27 19:57     ` Stefan Monnier
2002-07-02 15:02       ` Juanma Barranquero
2002-07-02 15:18         ` Stefan Monnier
2002-07-02 15:50           ` Juanma Barranquero
2002-06-29  8:41     ` Richard Stallman
2002-07-02 15:15       ` Juanma Barranquero
2002-07-02 15:49         ` Eli Zaretskii
2002-07-03 11:16           ` Juanma Barranquero
2002-07-03 20:57         ` Richard Stallman
2002-07-03 21:32           ` Simon Josefsson
2002-07-04  5:09             ` Eli Zaretskii
2002-07-04  7:58           ` Juanma Barranquero
2002-07-04 10:13             ` Eli Zaretskii
2002-07-04 11:52               ` Juanma Barranquero
2002-07-06 10:38                 ` Eli Zaretskii
2002-07-04 11:02             ` Simon Josefsson
2002-07-04 12:08               ` Juanma Barranquero
2002-07-04 12:19                 ` Miles Bader
2002-07-04 13:31                   ` Juanma Barranquero
2002-07-04 14:02                   ` Simon Josefsson
2002-07-04 14:00                 ` Simon Josefsson
2002-07-04 15:20                   ` Juanma Barranquero
2002-07-17  2:58                     ` emacs and guile (Re: ehelp woes, or why I hate a module that I love so much) Ken Raeburn
2002-07-17  7:13                       ` Juanma Barranquero
2002-07-17  9:11                       ` Kai Großjohann
2002-07-18 14:54                         ` Richard Stallman
2002-07-18 21:45                         ` Ken Raeburn
2002-07-18 14:55                       ` Richard Stallman
2002-07-18 20:13                         ` Ken Raeburn
2002-07-19 13:03                           ` Andreas Schwab
2002-07-19 16:24                             ` Ken Raeburn
2002-07-19 16:54                           ` Richard Stallman
2002-07-19 17:51                             ` Ken Raeburn
2002-07-18 14:56                       ` Richard Stallman
2002-07-18 19:54                         ` Ken Raeburn
2002-07-19  4:23                           ` Stefan Monnier
2002-07-19 12:56                             ` Ken Raeburn
2002-07-19 13:34                               ` Stefan Monnier [this message]
2002-07-19 14:16                                 ` Andreas Schwab
2002-07-19 15:04                                   ` Stefan Monnier
2002-07-19 16:54                           ` Richard Stallman
2002-07-19 17:48                             ` Ken Raeburn
2002-07-19 18:25                             ` Marius Vollmer
2002-07-20  0:35                               ` Richard Stallman
2002-07-20 12:00                                 ` Marius Vollmer
2002-07-21 20:14                                   ` Richard Stallman
2002-07-19 16:54                           ` Richard Stallman
2002-07-04 19:07             ` ehelp woes, or why I hate a module that I love so much Henrik Enberg
2002-07-05  0:49               ` Juanma Barranquero
2002-07-05 11:15                 ` Per Abrahamsen
2002-07-05 10:48             ` Richard Stallman

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=200207191334.g6JDYMe15622@rum.cs.yale.edu \
    --to=monnier+gnu/emacs@rum.cs.yale.edu \
    --cc=emacs-devel@gnu.org \
    --cc=rms@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).