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: Wed, 26 Feb 2020 22:02:29 +0100 Message-ID: <87zhd5awpm.fsf@gnu.org> References: <87wo8mcs1j.fsf@trouble.defaultvalue.org> <875zg19qpl.fsf@gnu.org> <87h7zeo06f.fsf@igalia.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="115570"; 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 Wed Feb 26 22:05:32 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 1j73s3-000TxI-GU for guile-bugs@m.gmane-mx.org; Wed, 26 Feb 2020 22:05:31 +0100 Original-Received: from localhost ([::1]:50017 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j73s2-0005dT-Fu for guile-bugs@m.gmane-mx.org; Wed, 26 Feb 2020 16:05:30 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47170) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j73pg-0002KN-1B for bug-guile@gnu.org; Wed, 26 Feb 2020 16:03:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j73pd-00073J-Sn for bug-guile@gnu.org; Wed, 26 Feb 2020 16:03:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51849) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j73pd-000737-OB for bug-guile@gnu.org; Wed, 26 Feb 2020 16:03:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j73pd-0000JF-L8 for bug-guile@gnu.org; Wed, 26 Feb 2020 16:03: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: Wed, 26 Feb 2020 21:03: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.1582750963744 (code B ref 39634); Wed, 26 Feb 2020 21:03:01 +0000 Original-Received: (at 39634) by debbugs.gnu.org; 26 Feb 2020 21:02:43 +0000 Original-Received: from localhost ([127.0.0.1]:57822 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j73pL-0000Bg-6K for submit@debbugs.gnu.org; Wed, 26 Feb 2020 16:02:43 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59992) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j73pI-00006k-Qh for 39634@debbugs.gnu.org; Wed, 26 Feb 2020 16:02:41 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:51168) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j73pC-0006aq-7o; Wed, 26 Feb 2020 16:02:34 -0500 Original-Received: from 128.pool80-103-133.dynamic.orange.es ([80.103.133.128]:43056 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j73pA-0007Oi-Ps; Wed, 26 Feb 2020 16:02:33 -0500 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 8 =?UTF-8?Q?Vent=C3=B4se?= an 228 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu 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:9598 Archived-At: Hi Andy! Andy Wingo skribis: > On Thu 20 Feb 2020 17:19, Ludovic Court=C3=A8s writes: > >> Of all the scm_tc7_ values listed in =E2=80=98scm.h=E2=80=99, the follow= ing are not >> explicitly listed (so they go to the default case that hashes the first >> word): > > Reformatting your list so I can check one by one :) > >> variable, >> hashtable, >> fluid, >> dynamic_state, >> frame, >> atomic_box, >> program, >> vm_cont, >> weak_set, >> weak_table, >> port > > No equal? implementation, so should hashq() instead. > >> bytevector, >> array, >> bitvector, > > These have equal? implementations, and what's more, a bitvector can > equal? an array... I think we have another bug! > > ;; Project 2d array as 1d array (scm_tc7_array) > (define x > (make-shared-array #2b((#t #t #t)) (lambda (i) (list 0 i)) '(0 2))) > ;; scm_tc7_bitvector > (define y #*111) > > (equal? x y) ;; =3D> #t > (equal? (hash x #xffffffff) (hash y #xffffffff)) ;; =3D> #f >=20=20=20=20=20=20=20=20=20=20=20=20=20 > Similarly for 1-d scm_tc7_array versus regular vectors, bytevectors, > etc. Oops. > Fixing this will not be straightforward... I think basically 1d arrays > need some special hashing logic so that e.g. vectors and 1d arrays hash > to the same thing. OK. >> stringbuf, >> values, > > These are never exposed to Scheme, and never compared using equal? > AFAIU. No need for special cases. Agreed. > Basically I think the tc7 case should default to hashq, and include > special cases for the ones that have equal? implementations or which > have read syntax. > > Sound right to you? It does, yes. Thanks for looking into it, Ludo=E2=80=99.