GNU bug report logs - #36139
[PATCH] Make better use of the switch op in cond forms

Previous Next

Package: emacs;

Reported by: Mattias Engdegård <mattiase <at> acm.org>

Date: Sat, 8 Jun 2019 15:16:02 UTC

Severity: wishlist

Tags: patch

Done: Mattias Engdegård <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: 36139 <at> debbugs.gnu.org
Subject: Re: bug#36139: [PATCH] Make better use of the switch op in cond forms
Date: Tue, 18 Jun 2019 14:56:44 -0400
> Allow switch generation with a mixture of eq, eql, equal, memq, memql and member.

AFAIK all of those give the same result (in practice) as using
equal/member: I'm having a hard time imagining an eq/eql/memq/memql test
against a constant which behaves differently from equal/member except
for those that can simply always return nil (e.g. (eq x "toto") can
always return nil since there's no way the caller of this code can make
sure x is really the same string object as the "toto" generated by the
compiler).

So I think we should "standardize" on equal/member and mostly disregard
the eq/eql/equal difference (except maybe for emitting a warning when
comparing against something where `equal` doesn't give the same result).


        Stefan





This bug report was last modified 5 years and 323 days ago.

Previous Next


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