* Hash values of symbols: why look at the name?
@ 2014-09-16 0:19 Daniel Colascione
2014-09-16 3:00 ` Stefan Monnier
0 siblings, 1 reply; 2+ messages in thread
From: Daniel Colascione @ 2014-09-16 0:19 UTC (permalink / raw
To: Emacs developers
[-- Attachment #1: Type: text/plain, Size: 817 bytes --]
Right now, this form always evaluates to t:
(eql (sxhash (make-symbol "a")) (sxhash (make-symbol "a")))
This form always evaluates to nil:
(equal (make-symbol "a") (make-symbol "a"))
The hash of a symbol is the hash of its namel; that seems silly, since
symbol equality is based on identity. We should be able to just use the
symbol address instead, right?
=== modified file 'src/fns.c'
--- src/fns.c 2014-09-15 05:09:44 +0000
+++ src/fns.c 2014-09-16 00:14:52 +0000
@@ -4482,13 +4482,10 @@
break;
case Lisp_Misc:
+ case Lisp_Symbol:
hash = XHASH (obj);
break;
- case Lisp_Symbol:
- obj = SYMBOL_NAME (obj);
- /* Fall through. */
-
case Lisp_String:
hash = sxhash_string (SSDATA (obj), SBYTES (obj));
break;
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-16 3:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-16 0:19 Hash values of symbols: why look at the name? Daniel Colascione
2014-09-16 3:00 ` Stefan Monnier
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.