From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Newsgroups: gmane.lisp.guile.bugs Subject: bug#39634: All keyowrds hash to the same value Date: Fri, 06 Mar 2020 15:42:20 +0100 Message-ID: <87sgilmto3.fsf@gnu.org> References: <87wo8mcs1j.fsf@trouble.defaultvalue.org> <875zg19qpl.fsf@gnu.org> <87h7zeo06f.fsf@igalia.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="11044"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: 39634@debbugs.gnu.org, Rob Browning To: Andy Wingo Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Fri Mar 06 15:43:10 2020 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jAEBw-0002i2-2s for guile-bugs@m.gmane-mx.org; Fri, 06 Mar 2020 15:43:08 +0100 Original-Received: from localhost ([::1]:37746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jAEBv-0000wB-4c for guile-bugs@m.gmane-mx.org; Fri, 06 Mar 2020 09:43:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46591) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jAEBq-0000w3-QN for bug-guile@gnu.org; Fri, 06 Mar 2020 09:43:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jAEBp-00024X-Rd for bug-guile@gnu.org; Fri, 06 Mar 2020 09:43:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38350) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jAEBp-00024R-Op for bug-guile@gnu.org; Fri, 06 Mar 2020 09:43:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jAEBp-0002Nn-MK for bug-guile@gnu.org; Fri, 06 Mar 2020 09:43:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 06 Mar 2020 14:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39634 X-GNU-PR-Package: guile Original-Received: via spool by 39634-submit@debbugs.gnu.org id=B39634.15835057529115 (code B ref 39634); Fri, 06 Mar 2020 14:43:01 +0000 Original-Received: (at 39634) by debbugs.gnu.org; 6 Mar 2020 14:42:32 +0000 Original-Received: from localhost ([127.0.0.1]:44323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jAEBL-0002Mw-S4 for submit@debbugs.gnu.org; Fri, 06 Mar 2020 09:42:32 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59303) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jAEBK-0002Mg-9E for 39634@debbugs.gnu.org; Fri, 06 Mar 2020 09:42:30 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:49660) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jAEBD-0000v3-GM; Fri, 06 Mar 2020 09:42:23 -0500 Original-Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=60276 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jAEBD-0004RD-0I; Fri, 06 Mar 2020 09:42:23 -0500 In-Reply-To: <87h7zeo06f.fsf@igalia.com> (Andy Wingo's message of "Tue, 25 Feb 2020 21:56:56 +0100") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.io gmane.lisp.guile.bugs:9611 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Andy Wingo skribis: >> variable, >> hashtable, >> fluid, >> dynamic_state, >> frame, >> atomic_box, >> program, >> vm_cont, >> weak_set, >> weak_table, >> port > > No equal? implementation, so should hashq() instead. Here=E2=80=99s a patch for these, let me know what you think! (Of course longer term it=E2=80=99d be nice to have a centralized way to de= clare each tc7 with its equal and hash methods.) Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/libguile/hash.c b/libguile/hash.c index c51a794c9..9cb8fcedd 100644 --- a/libguile/hash.c +++ b/libguile/hash.c @@ -1,4 +1,4 @@ -/* Copyright 1995-1997,2000-2001,2003-2004,2006,2008-2015,2017-2018 +/* Copyright 1995-1997,2000-2001,2003-2004,2006,2008-2015,2017-2018,2020 Free Software Foundation, Inc. This file is part of Guile. @@ -331,6 +331,22 @@ scm_raw_ihash (SCM obj, size_t depth) h ^= scm_raw_ihash (scm_syntax_module (obj), depth); return h; } + + /* The following tc7s have no 'equal?' implementation. Thus, just + fall back to 'hashq'. */ + case scm_tc7_variable: + case scm_tc7_hashtable: + case scm_tc7_fluid: + case scm_tc7_dynamic_state: + case scm_tc7_frame: + case scm_tc7_atomic_box: + case scm_tc7_program: + case scm_tc7_vm_cont: + case scm_tc7_weak_set: + case scm_tc7_weak_table: + case scm_tc7_port: + return scm_raw_ihashq (SCM_UNPACK (obj)); + case scm_tcs_cons_imcar: case scm_tcs_cons_nimcar: if (depth) --=-=-=--