GNU bug report logs - #31350
27.0; `pcase' message: "Redundant pcase pattern"

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Thu, 3 May 2018 00:49:01 UTC

Severity: minor

Tags: fixed, moreinfo

Found in version 27.0

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: Drew Adams <drew.adams <at> oracle.com>
To: Michael Heerdegen <michael_heerdegen <at> web.de>, Lars Ingebrigtsen
 <larsi <at> gnus.org>
Cc: 31350 <at> debbugs.gnu.org
Subject: RE: bug#31350: 27.0; `pcase' message: "Redundant pcase pattern"
Date: Sat, 3 Oct 2020 15:58:34 -0700 (PDT)
> Well, when we compile something like
> 
> (defun test (foo recursivep)
>   (pcase foo
>     (a `(not ,a))
>     ((and a (guard recursivep))
>      `(not ,a))))
> 
> the message Drew means says
> 
>   Redundant pcase pattern: (and a (guard recursivep))
> 
> I'm happy with that, I think it tells anything I need to know.  I'm not
> happy about the fact that I missed the `message' because it's only a
> message and I only see it when I look into the *Messages* buffer because
> it's overwritten very soon in the echo area.
> 
> The compiler log only shows
> 
> Compiling file /home/micha/today/pctest.el at Sun Oct  4 00:44:51 2020
> pctest.el:46:1: Warning: Unused lexical argument `recursivep'
> 
> which is confusing if you missed the message about the redundant
> pattern.

The ephemeral (so hidden) message is another problem.

I'll repeat the request, which is what I think a user
would like to know:

  Can the messaging at least tell you:
  (1) all of a set of clauses that are mutually redundant and
  (2) which one of them will actually be used by the compiled
      code, the others presumably having been pruned?

IOW, what's the actual effect, for users?  How does pcase
deal with the redundancy?  Can that at least be documented
somewhere (maybe it is already)?




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

Previous Next


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