From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: bug#39634: All keyowrds hash to the same value Date: Tue, 25 Feb 2020 21:56:56 +0100 Message-ID: <87h7zeo06f.fsf@igalia.com> References: <87wo8mcs1j.fsf@trouble.defaultvalue.org> <875zg19qpl.fsf@gnu.org> 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="52295"; 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Tue Feb 25 21:58:11 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 1j6hHO-000DTu-OZ for guile-bugs@m.gmane-mx.org; Tue, 25 Feb 2020 21:58:10 +0100 Original-Received: from localhost ([::1]:35028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6hHN-0003Jn-Mo for guile-bugs@m.gmane-mx.org; Tue, 25 Feb 2020 15:58:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56736) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6hHH-0003JQ-Ju for bug-guile@gnu.org; Tue, 25 Feb 2020 15:58:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6hHG-00036D-H8 for bug-guile@gnu.org; Tue, 25 Feb 2020 15:58:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50212) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6hHG-00035q-DE for bug-guile@gnu.org; Tue, 25 Feb 2020 15:58:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j6hHG-0006RF-As for bug-guile@gnu.org; Tue, 25 Feb 2020 15:58:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andy Wingo Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Tue, 25 Feb 2020 20:58:02 +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.158266423624695 (code B ref 39634); Tue, 25 Feb 2020 20:58:02 +0000 Original-Received: (at 39634) by debbugs.gnu.org; 25 Feb 2020 20:57:16 +0000 Original-Received: from localhost ([127.0.0.1]:56185 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j6hGW-0006QF-CQ for submit@debbugs.gnu.org; Tue, 25 Feb 2020 15:57:16 -0500 Original-Received: from fanzine.igalia.com ([178.60.130.6]:55919) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j6hGU-0006Q0-LO for 39634@debbugs.gnu.org; Tue, 25 Feb 2020 15:57:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=qoSUO4FjisvWUuXv6Dh879dpi810BTLt0B4m0sc6wIE=; b=lwf4b53qCsRn8Y4hPAM7CyHl3TuCzcaBHB32vidrbtcKjdo71wf6xut+9UGyKlfQrlynzZqfGzTRClWkzSK6gWT/J9JeJO5ipaWpbZiJyt3KtcLBf34u8WBvY2Kk8Lj7olnaVHAyaymDXtjDbUQhN8KXXC9tsu+ge5VB75GtZm+ouqqG6drlc8USSNH/HpprLpCsdAhZ0xEc+ZecCZpRKMfj486rCGaqc6yKeTp9hp9uKm5ECOWoQfSzMwgSCVxxeHxFnRDmqaleLrq8WjP0l5gQPTLF2qXIYx3WFgQp+LuCrISVmWbwtMwaaVyrQSTrANnBDcvtYOzOE/1bjB5a3A==; Original-Received: from [88.123.12.110] (helo=sparrow) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1j6hGN-0005Sh-Ro; Tue, 25 Feb 2020 21:57:08 +0100 In-Reply-To: <875zg19qpl.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Thu, 20 Feb 2020 17:19:18 +0100") 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:9595 Archived-At: 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 followi= ng 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 Similarly for 1-d scm_tc7_array versus regular vectors, bytevectors, etc. 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. > stringbuf, > values, These are never exposed to Scheme, and never compared using equal? AFAIU. No need for special cases. 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? Andy