From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: David Kastrup Newsgroups: gmane.lisp.guile.bugs Subject: bug#41354: equal? has no sensible code path for symbols Date: Sun, 17 May 2020 12:49:50 +0200 Message-ID: <87v9kuzvht.fsf@fencepost.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="114448"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: 41354@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Sun May 17 12:50:08 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 1jaGrv-000Te7-Ab for guile-bugs@m.gmane-mx.org; Sun, 17 May 2020 12:50:07 +0200 Original-Received: from localhost ([::1]:58864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaGru-0000kV-BV for guile-bugs@m.gmane-mx.org; Sun, 17 May 2020 06:50:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaGrq-0000kC-LM for bug-guile@gnu.org; Sun, 17 May 2020 06:50:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59073) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaGrq-0006RL-CE for bug-guile@gnu.org; Sun, 17 May 2020 06:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jaGrq-0001cp-7x for bug-guile@gnu.org; Sun, 17 May 2020 06:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: David Kastrup Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 17 May 2020 10:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41354 X-GNU-PR-Package: guile X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15897125956229 (code B ref -1); Sun, 17 May 2020 10:50:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 May 2020 10:49:55 +0000 Original-Received: from localhost ([127.0.0.1]:42386 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaGrj-0001cO-7o for submit@debbugs.gnu.org; Sun, 17 May 2020 06:49:55 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:57936) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaGrh-0001cG-R0 for submit@debbugs.gnu.org; Sun, 17 May 2020 06:49:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43532) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaGrh-0000jr-Iy for bug-guile@gnu.org; Sun, 17 May 2020 06:49:53 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57076) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaGrh-0006R4-A1 for bug-guile@gnu.org; Sun, 17 May 2020 06:49:53 -0400 Original-Received: from x5d849d3d.dyn.telefonica.de ([93.132.157.61]:34774 helo=lola) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jaGrg-00083A-Rd for bug-guile@gnu.org; Sun, 17 May 2020 06:49:53 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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:9766 Archived-At: In Scheme, symbols can be compared using eq? for equality. However, since they have garbage-collected content attached, they do not meet the predicate SCM_IMP in the short-circuit evaluation at the start of equal? This means that unequal symbols compared using equal? fall through a whole bunch of tests and end up in a general structural comparison comparing their underlying string names. This completely sabotages the semantics symbols are intended for. Behavior for eqv? is similar but the fall-through at least is not as expensive as it is for equal? . -- David Kastrup