GNU bug report logs - #39634
All keyowrds hash to the same value

Previous Next

Package: guile;

Reported by: Rob Browning <rlb <at> defaultvalue.org>

Date: Sun, 16 Feb 2020 18:22:02 UTC

Severity: important

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 39634 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Rob Browning <rlb <at> defaultvalue.org>
Cc: 39634 <at> debbugs.gnu.org, Andy Wingo <wingo <at> igalia.com>
Subject: Re: bug#39634: All keyowrds hash to the same value
Date: Thu, 20 Feb 2020 17:19:18 +0100
Hi Rob,

Rob Browning <rlb <at> defaultvalue.org> skribis:

>>From b380102564aad053f22586eb404e99c82635a3b0 Mon Sep 17 00:00:00 2001
> From: Rob Browning <rlb <at> defaultvalue.org>
> Date: Sun, 16 Feb 2020 12:12:08 -0600
> Subject: [PATCH 1/1] Implement hashing for keywords, i.e. (hash #:x ...)
>
> Add keyword handling to (hash ...).  Previously it would just return the
> same value for all keywords.
>
> * libguile/hash.c (scm_raw_ihash): Add scm_tc7_keyword case.
>
> * libguile/keywords.h (SCM_I_KEYWORD_HASH): New macro.

LGTM, please push!

Andy and I discussed it on IRC and despite the fact that it’s an ABI
change, we thought including the fix in 3.0.1 was probably the better
option.

Of all the scm_tc7_ values listed in ‘scm.h’, the following are not
explicitly listed (so they go to the default case that hashes the first
word):

  variable, hashtable, fluid, stringbuf, dynamic_state, frame,
  atomic_box, values, program, vm_cont, bytevector, weak_set,
  weak_table, array, bitvector, port

So for example all input file ports hash to the same value, all
3-element bytevectors hash to the same value, etc.

We can probably omit stringbuf, dynamic_state, and values, but the rest
should probably be fixed.

WDYT, Andy?

Thanks,
Ludo’.




This bug report was last modified 5 years and 135 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.