From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.bugs Subject: bug#31311: 27.0; doc of `pcase' Date: Tue, 15 May 2018 16:24:44 +0200 Message-ID: <87y3gl574j.fsf@gnuvola.org> References: <83wowqrmp8.fsf@gnu.org> <87efixlv8g.fsf@web.de> <83muxlsvfm.fsf@gnu.org> <871sexlqvw.fsf@web.de> <83k1sps9n3.fsf@gnu.org> <87wowpndoo.fsf@gmail.com> <87fu3c6cm3.fsf@gnuvola.org> <83zi1kqynx.fsf@gnu.org> <871seh3yw8.fsf@gnuvola.org> <877eo9kmid.fsf@web.de> Reply-To: 31311@debbugs.gnu.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1526394845 25897 195.159.176.226 (15 May 2018 14:34:05 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 15 May 2018 14:34:05 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Michael Heerdegen To: 31311@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 15 16:34:01 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1fIb1c-0006cM-Eq for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 May 2018 16:34:00 +0200 Original-Received: from localhost ([::1]:41096 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIb3j-0002Rk-Ic for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 May 2018 10:36:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46910) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIb2i-0001aZ-IN for bug-gnu-emacs@gnu.org; Tue, 15 May 2018 10:35:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fIb2c-0007zX-U2 for bug-gnu-emacs@gnu.org; Tue, 15 May 2018 10:35:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56202) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fIb2c-0007zK-Qw for bug-gnu-emacs@gnu.org; Tue, 15 May 2018 10:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fIb2c-0003Oe-Fl for bug-gnu-emacs@gnu.org; Tue, 15 May 2018 10:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Thien-Thi Nguyen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 May 2018 14:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31311 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31311-submit@debbugs.gnu.org id=B31311.152639489013028 (code B ref 31311); Tue, 15 May 2018 14:35:02 +0000 Original-Received: (at 31311) by debbugs.gnu.org; 15 May 2018 14:34:50 +0000 Original-Received: from localhost ([127.0.0.1]:35865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fIb2P-0003O4-V7 for submit@debbugs.gnu.org; Tue, 15 May 2018 10:34:50 -0400 Original-Received: from mail.agora-net.com ([67.59.132.6]:53977) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fIb2M-0003No-KB for 31311@debbugs.gnu.org; Tue, 15 May 2018 10:34:46 -0400 Original-Received: from ttn by mail.agora-net.com with local (Exim 4.82) (envelope-from ) id 1fIb2K-0000jT-T7; Tue, 15 May 2018 10:34:45 -0400 Original-Received: from ttn by zigzag.favinet with local (Exim 4.80) (envelope-from ) id 1fIasp-0000dr-Gg; Tue, 15 May 2018 16:24:55 +0200 Mail-Followup-To: 31311@debbugs.gnu.org In-Reply-To: <877eo9kmid.fsf@web.de> (Michael Heerdegen's message of "Sat, 12 May 2018 15:54:18 +0200") X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: ttn@gnuvola.org X-SA-Exim-Scanned: No (on mail.agora-net.com); SAEximRunCond expanded to false X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:146195 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable () Michael Heerdegen () Sat, 12 May 2018 15:54:18 +0200 > a. (pcase t ('t 'true)) =3D> true > b. (pcase nil ('nil 'false)) =3D> false > c. (pcase t (t 'true)) =3D> true > d. (pcase nil (nil 'false)) |=3D ERROR: Unknown pattern =E2=80=98n= il=E2=80=99 That's all correct and intended - see 3ef31167. t was originally intended as catchall pattern equivalent to _ but has been deprecated (since it was confusing). Try e.g. (pcase nil (t t)) You get a message when you use it, but when evaluating and not when compiling (so you must look in the *Messages* buffer - I don't think this is intended...). A catch-nothing pattern is not useful, so nil is just invalid. Thanks. I've added a blurb suggesting to avoid both =E2=80=98t=E2=80=99 and =E2=80=98nil=E2=80=99 (commit 5fc0f24c). Here's the text: Two symbols to avoid are @code{t}, which behaves like @code{_} (above) and is deprecated, and @code{nil}, which signals error. It makes no sense to bind these (@pxref{Constant Variables}). This is in the table, part of the @var{symbol} entry. =2D-=20 Thien-Thi Nguyen ----------------------------------------------- (defun responsep (query) (pcase (context query) (`(technical ,ml) (correctp ml)) ...)) 748E A0E8 1CB8 A748 9BFA =2D-------------------------------------- 6CE4 6703 2224 4C80 7502 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlr67bAACgkQZwMiJEyAdQISTQCg201f3YyyMtob9mpszxpOKQK+ yKYAniUmDQLA32t6Vpj9K1EsVCw7pJVw =YIfR -----END PGP SIGNATURE----- --=-=-=--