[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#41354: equal? has no sensible code path for symbols
From: |
David Kastrup |
Subject: |
bug#41354: equal? has no sensible code path for symbols |
Date: |
Sun, 17 May 2020 12:49:50 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
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
- bug#41354: equal? has no sensible code path for symbols,
David Kastrup <=