From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: pcase: Semantics of atom QPATS Date: Wed, 13 Jun 2018 08:52:25 -0400 Message-ID: References: <87tvqbjwyf.fsf@web.de> <87k1r3qro3.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1528894320 1357 195.159.176.226 (13 Jun 2018 12:52:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 13 Jun 2018 12:52:00 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 13 14:51:56 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fT5Fj-0000E3-TJ for ged-emacs-devel@m.gmane.org; Wed, 13 Jun 2018 14:51:56 +0200 Original-Received: from localhost ([::1]:33971 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fT5Hr-0001DQ-31 for ged-emacs-devel@m.gmane.org; Wed, 13 Jun 2018 08:54:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fT5GK-00008p-08 for emacs-devel@gnu.org; Wed, 13 Jun 2018 08:52:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fT5GG-0006fI-19 for emacs-devel@gnu.org; Wed, 13 Jun 2018 08:52:32 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:55984) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fT5GF-0006cc-SX for emacs-devel@gnu.org; Wed, 13 Jun 2018 08:52:27 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w5DCqsYO029999; Wed, 13 Jun 2018 08:52:54 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 18E1B655DC; Wed, 13 Jun 2018 08:52:25 -0400 (EDT) In-Reply-To: <87k1r3qro3.fsf@web.de> (Michael Heerdegen's message of "Wed, 13 Jun 2018 05:41:32 +0200") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6307=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6307> : inlines <6692> : streams <1789564> : uri <2657480> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:226288 Archived-At: >> Which is why I prefer signaling an error: it lets us extend the >> semantics of ` without any fear of breaking backward compatibility. > May I add a comment like this to clarify? Sure. Feel free to add support for floats while you're there. Stefan > lisp/emacs-lisp/pcase.el | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el > index d3e8899706..32c36ab2cd 100644 > --- a/lisp/emacs-lisp/pcase.el > +++ b/lisp/emacs-lisp/pcase.el > @@ -981,6 +981,8 @@ pcase--u1 > (app car ,(list '\` (car qpat))) > (app cdr ,(list '\` (cdr qpat))))) > ((or (stringp qpat) (integerp qpat) (symbolp qpat)) `',qpat) > + ;; In all other cases just raise an error so we can't break > + ;; backward compatibility in the future: > (t (error "Unknown QPAT: %S" qpat)))) > > (provide 'pcase)