unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: David Kastrup <dak@gnu.org>
Cc: 41354@debbugs.gnu.org
Subject: bug#41354: equal? has no sensible code path for symbols
Date: Wed, 27 May 2020 22:39:59 +0200	[thread overview]
Message-ID: <875zchjen4.fsf@gnu.org> (raw)
In-Reply-To: <87v9kuzvht.fsf@fencepost.gnu.org> (David Kastrup's message of "Sun, 17 May 2020 12:49:50 +0200")

Hi David,

David Kastrup <dak@gnu.org> skribis:

> 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.

‘equal?’ starts by checking for eq-ness, which LGTM:

  SCM
  scm_equal_p (SCM x, SCM y)
  #define FUNC_NAME s_scm_i_equal_p
  {
    SCM_CHECK_STACK;
   tailrecurse:
    SCM_TICK;
    if (scm_is_eq (x, y))
      return SCM_BOOL_T;

Or were you referring to something else?

Thanks,
Ludo’.





  reply	other threads:[~2020-05-27 20:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-17 10:49 bug#41354: equal? has no sensible code path for symbols David Kastrup
2020-05-27 20:39 ` Ludovic Courtès [this message]
2020-05-27 20:49   ` David Kastrup
2020-05-28 16:06     ` Ludovic Courtès
2020-05-28 16:50       ` David Kastrup
2020-05-29  8:05         ` Ludovic Courtès
2021-01-19 21:53           ` David Kastrup

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=875zchjen4.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=41354@debbugs.gnu.org \
    --cc=dak@gnu.org \
    /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).