From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.bugs Subject: bug#16567: 24.3.50; pcase should signal an error if no case matches Date: Mon, 27 Jan 2014 12:56:06 +0100 Message-ID: References: <877g9lzpm9.fsf@tanger.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1390823835 466 80.91.229.3 (27 Jan 2014 11:57:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 27 Jan 2014 11:57:15 +0000 (UTC) Cc: 16567@debbugs.gnu.org To: Daimrod Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jan 27 12:57:21 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W7kob-0005Lu-EG for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Jan 2014 12:57:21 +0100 Original-Received: from localhost ([::1]:59052 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7kob-0007X5-4c for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Jan 2014 06:57:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7koQ-0007Wl-9J for bug-gnu-emacs@gnu.org; Mon, 27 Jan 2014 06:57:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7koJ-0006lq-0H for bug-gnu-emacs@gnu.org; Mon, 27 Jan 2014 06:57:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51681) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7koI-0006lk-Ss for bug-gnu-emacs@gnu.org; Mon, 27 Jan 2014 06:57:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1W7koI-0003Yl-CP for bug-gnu-emacs@gnu.org; Mon, 27 Jan 2014 06:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Helmut Eller Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Jan 2014 11:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16567 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16567-submit@debbugs.gnu.org id=B16567.139082377313619 (code B ref 16567); Mon, 27 Jan 2014 11:57:02 +0000 Original-Received: (at 16567) by debbugs.gnu.org; 27 Jan 2014 11:56:13 +0000 Original-Received: from localhost ([127.0.0.1]:37467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7knU-0003Xb-Nd for submit@debbugs.gnu.org; Mon, 27 Jan 2014 06:56:12 -0500 Original-Received: from mail-ee0-f49.google.com ([74.125.83.49]:33095) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7knR-0003XS-UJ for 16567@debbugs.gnu.org; Mon, 27 Jan 2014 06:56:10 -0500 Original-Received: by mail-ee0-f49.google.com with SMTP id d17so2183920eek.22 for <16567@debbugs.gnu.org>; Mon, 27 Jan 2014 03:56:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=hpKi3NrPLJipYsIdppX6x1/4ICMoqMx1lpzqTqxcilA=; b=Z4Vm3mQGlg2oO6gAY2sol/08nwVoDWiLnh+bAukL5kps8QqxaNMEkkzMveynTTAnPZ 1KqZoFZVrsFCA7a1r9afq4OMJ5v9HyXv5ByHMz79UpluIJjLwMB335GjyokRGNrFgOXB 1mHSNzgfes+KPQcWmVsuTxKvrmsuwPHSYymxZWJoJRTjZwaXkP5WNu61kvPfAtc3NnpR oGIDYtKws52+7IFgYZfE0HFb/32vfgFkn8O5q7H524Xz6WC5GSihAkk94xQdKNEfPECL ZQMJ2yP8j1SdhweThZZCd0ZgXBkGcWe56X3B3nsQRImuy5DdxZpq4pC8bLx+6EKtROi1 +kSg== X-Received: by 10.14.199.68 with SMTP id w44mr498055een.98.1390823769089; Mon, 27 Jan 2014 03:56:09 -0800 (PST) Original-Received: from ix ([212.46.176.45]) by mx.google.com with ESMTPSA id j42sm41577201eep.21.2014.01.27.03.56.07 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 27 Jan 2014 03:56:08 -0800 (PST) Original-Received: from helmut by ix with local (Exim 4.80) (envelope-from ) id 1W7knO-0000ys-7T; Mon, 27 Jan 2014 12:56:06 +0100 In-Reply-To: <877g9lzpm9.fsf@tanger.home> (daimrod@gmail.com's message of "Mon, 27 Jan 2014 11:27:26 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:84107 Archived-At: On Mon, Jan 27 2014, Daimrod wrote: > Helmut Eller writes: > >> pcase returns nil for this example: >> >> (pcase 3 >> (1 1) >> (2 2)) >> >> it would be more useful if it would signal an error instead. Manually >> adding a "catch-all case" and inventing some error message is tedious >> and it's also easy to forget. > > Wouldn't a `epcase' (as in `cl-ecase') be more appropriate for this > use-case? My gut feeling is that in 80% of all situations ECASE is more or just as appropriate as CASE. Or put differently it's very uncommon that CASE is preferable to ECASE. Therefore I think pcase should singal an error by default. The nice thing about a epcase would be the symmetry/analogy to ECASE/ETYPECASE. But that seems like a minor advantage. Helmut