From: "Ludovic Courtès" <ludo@gnu.org>
To: Rob Browning <rlb@defaultvalue.org>
Cc: 39634@debbugs.gnu.org, Andy Wingo <wingo@igalia.com>
Subject: bug#39634: All keyowrds hash to the same value
Date: Thu, 20 Feb 2020 17:19:18 +0100 [thread overview]
Message-ID: <875zg19qpl.fsf@gnu.org> (raw)
In-Reply-To: <87wo8mcs1j.fsf@trouble.defaultvalue.org> (Rob Browning's message of "Sun, 16 Feb 2020 12:20:56 -0600")
Hi Rob,
Rob Browning <rlb@defaultvalue.org> skribis:
>>From b380102564aad053f22586eb404e99c82635a3b0 Mon Sep 17 00:00:00 2001
> From: Rob Browning <rlb@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’.
next prev parent reply other threads:[~2020-02-20 16:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-16 18:20 bug#39634: All keyowrds hash to the same value Rob Browning
2020-02-20 16:19 ` Ludovic Courtès [this message]
2020-02-25 20:56 ` Andy Wingo
2020-02-25 22:13 ` lloda
2020-02-26 21:02 ` Ludovic Courtès
2020-03-06 14:42 ` Ludovic Courtès
2020-03-06 15:43 ` Andy Wingo
2020-03-06 16:19 ` Ludovic Courtès
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/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=875zg19qpl.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=39634@debbugs.gnu.org \
--cc=rlb@defaultvalue.org \
--cc=wingo@igalia.com \
/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.
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).