GNU bug report logs - #41354
equal? has no sensible code path for symbols

Previous Next

Package: guile;

Reported by: David Kastrup <dak <at> gnu.org>

Date: Sun, 17 May 2020 10:50:02 UTC

Severity: normal

Full log


Message #8 received at 41354 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: David Kastrup <dak <at> gnu.org>
Cc: 41354 <at> debbugs.gnu.org
Subject: Re: bug#41354: equal? has no sensible code path for symbols
Date: Wed, 27 May 2020 22:39:59 +0200
Hi David,

David Kastrup <dak <at> 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’.




This bug report was last modified 4 years and 146 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.