unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Bug in sxhash
@ 2006-03-21 16:02 Kim F. Storm
  2006-03-23 23:09 ` Richard Stallman
  0 siblings, 1 reply; 3+ messages in thread
From: Kim F. Storm @ 2006-03-21 16:02 UTC (permalink / raw)



Is sxhash really supposed to ignore the cdr of a cons?

(sxhash '(a . 1))  => 57
(sxhash '(a . 2))  => 57
(sxhash '(a . 3))  => 57

It works ok for lists:

(sxhash '(a 1))  => 913
(sxhash '(a 2))  => 914
(sxhash '(a 3))  => 915


Below is a proposed patch which gives this result:

(sxhash '(a . 1))  => 913
(sxhash '(a . 2))  => 914
(sxhash '(a . 3))  => 915

[i.e. there is no difference between lists and cons,
but at least it isn't completely stupid]


*** fns.c	06 Feb 2006 18:21:46 +0100	1.407
--- fns.c	21 Mar 2006 16:57:07 +0100	
***************
*** 5114,5119 ****
--- 5114,5125 ----
  	hash = SXHASH_COMBINE (hash, hash2);
        }
  
+   if (!NILP (list))
+     {
+       unsigned hash2 = sxhash (list, depth + 1);
+       hash = SXHASH_COMBINE (hash2, hash);
+     }
+ 
    return hash;
  }
  

--
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug in sxhash
  2006-03-21 16:02 Bug in sxhash Kim F. Storm
@ 2006-03-23 23:09 ` Richard Stallman
  2006-03-24 13:29   ` Kim F. Storm
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Stallman @ 2006-03-23 23:09 UTC (permalink / raw)
  Cc: emacs-devel

I think your change is desirable--please install it.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug in sxhash
  2006-03-23 23:09 ` Richard Stallman
@ 2006-03-24 13:29   ` Kim F. Storm
  0 siblings, 0 replies; 3+ messages in thread
From: Kim F. Storm @ 2006-03-24 13:29 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

> I think your change is desirable--please install it.
Done.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-03-24 13:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-21 16:02 Bug in sxhash Kim F. Storm
2006-03-23 23:09 ` Richard Stallman
2006-03-24 13:29   ` Kim F. Storm

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).