GNU bug report logs - #16567
24.3.50; pcase should signal an error if no case matches

Previous Next

Package: emacs;

Reported by: Helmut Eller <eller.helmut <at> gmail.com>

Date: Mon, 27 Jan 2014 09:24:01 UTC

Severity: wishlist

Found in version 24.3.50

Fixed in version 25.1

Done: Leo Liu <sdl.web <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Helmut Eller <eller.helmut <at> gmail.com>
Cc: 16567 <at> debbugs.gnu.org
Subject: Re: bug#16567: 24.3.50;
 pcase should signal an error if no case matches
Date: Mon, 08 Sep 2014 20:41:01 -0400
> What could happen if you would change it?

Obviously: errors signaled instead of returning the expected nil.
Returning nil by default is "the norm" in Elisp (think of missing `else'
branches in `if', or missing default case in `cond' or even missing
default case in `cl-case'), so it's to be expected that pcase users
would rely on this default behavior as well, even if it strikes you as
utter nonsense.

> The "nil default" would make more sense in a pcase-if or pif macro.

Changing the default of `pcase' is not an option at this point.


        Stefan




This bug report was last modified 10 years and 290 days ago.

Previous Next


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