unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#41354: equal? has no sensible code path for symbols
@ 2020-05-17 10:49 David Kastrup
  2020-05-27 20:39 ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: David Kastrup @ 2020-05-17 10:49 UTC (permalink / raw)
  To: 41354


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





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-01-19 21:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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