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: Wed, 23 May 2018 21:16:42 +0200 Message-ID: <87r2m22ndx.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> <87y3gl574j.fsf@gnuvola.org> <87po1xc5lb.fsf@web.de> <87muwz6ftl.fsf@gnuvola.org> <874lj7r5mx.fsf@web.de> <878t8e2lw1.fsf@gnuvola.org> <83in7ecrxo.fsf@gnu.org> 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 1527102968 15927 195.159.176.226 (23 May 2018 19:16:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 23 May 2018 19:16:08 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: 31311@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 23 21:16:04 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 1fLZEx-00041w-Kx for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 May 2018 21:16:03 +0200 Original-Received: from localhost ([::1]:35099 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLZH4-0006ZG-Pk for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 May 2018 15:18:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLZGw-0006Xv-9F for bug-gnu-emacs@gnu.org; Wed, 23 May 2018 15:18:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fLZGs-0007CB-6d for bug-gnu-emacs@gnu.org; Wed, 23 May 2018 15:18:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37755) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fLZGs-0007C5-2R for bug-gnu-emacs@gnu.org; Wed, 23 May 2018 15:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fLZGr-0008Q5-TH for bug-gnu-emacs@gnu.org; Wed, 23 May 2018 15:18:01 -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: Wed, 23 May 2018 19:18:01 +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.152710304232305 (code B ref 31311); Wed, 23 May 2018 19:18:01 +0000 Original-Received: (at 31311) by debbugs.gnu.org; 23 May 2018 19:17:22 +0000 Original-Received: from localhost ([127.0.0.1]:45648 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fLZGE-0008Oy-6s for submit@debbugs.gnu.org; Wed, 23 May 2018 15:17:22 -0400 Original-Received: from mail.agora-net.com ([67.59.132.6]:52950) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fLZGC-0008Oq-2l for 31311@debbugs.gnu.org; Wed, 23 May 2018 15:17:20 -0400 Original-Received: from ttn by mail.agora-net.com with local (Exim 4.82) (envelope-from ) id 1fLZGB-0000mH-HP; Wed, 23 May 2018 15:17:19 -0400 Original-Received: from ttn by zigzag.favinet with local (Exim 4.80) (envelope-from ) id 1fLZFm-0002uo-RC; Wed, 23 May 2018 21:16:54 +0200 Mail-Followup-To: 31311@debbugs.gnu.org In-Reply-To: <83in7ecrxo.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 23 May 2018 18:28:19 +0300") 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:146444 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable () Eli Zaretskii () Wed, 23 May 2018 18:28:19 +0300 > +@c Issue: Should this be split off into its own > node/subsection? Why is this important? It is important because =E2=80=98pcase=E2=80=99 is a construct that selects based on new concepts: "pattern" and "matching". It also supports defining and sharing (to some extent) let-bindings. All the other conditional constructs select on value (squashed to boolean, that is), and don't have any let-binding support. It's true that the macro eventually expands to a =E2=80=98let=E2=80=99-wrap= ped =E2=80=98cond=E2=80=99, but my understanding that this expansion is an implementation detail -- maybe in the future it will be expanded in another more-fitting way. So, the new concepts stand on their own, rather than "stylized expressions for a predicate in the =E2=80=98cond=E2=80=99 CONDITION position". Also, =E2=80=98pcase=E2=80=99 is the only conditional construct that takes a first arg and evaluates it (like =E2=80=98case=E2=80=99). The new text exp= lains its hybrid nature (=E2=80=98cond=E2=80=99 and =E2=80=98case=E2=80=99) in mo= re detail. The last reason is that =E2=80=98pcase=E2=80=99 supports "sequencing patter= ns", i.e., =E2=80=98(and PAT...)=E2=80=99 and =E2=80=98(or PAT...)=E2=80=99. Th= ese are analogous to the same-named special forms documented in "Constructs for Combining Conditions" and the =E2=80=98pcase=E2=80=99 docs points that out = as a conceptual backward-direction xref. It's nice if the back-xref is also in the text as well. The reader sees/thinks: =2D conditionals / four, ok, simple, no prob =2D combining conditions / two, old hat, no prob =2D pcase "sequencing conditions" / two, xref AH! like =E2=80=98and=E2=80= =99, =E2=80=98or=E2=80=99 for patterns instead of for values, new hat but still no prob If we were to reverse the latter two (i.e., placing "Combining" last), the reader would encounter the xref in the forward direction. I feel strongly that it's desirable to minimize forward references in documentation (or work really hard to make them less disconcerting). You can always add subsections, subsubsections, etc., if you want to structure the text into more parts than it is already. In branch =E2=80=98fix/bug-31311-pcase-doc=E2=80=99 (note, not -squash), co= mmit 567342a88e53 does such a re-arranging. If you prefer, i can demote everything one level and move it back to "Conditionals". I'd then need to update that node's intro para to say "five". That might reduce the diff, too. However, i have explained (above) why i would be against this. =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) iEYEARECAAYFAlsFviAACgkQZwMiJEyAdQLE/ACfaTaotWyU/7tYcJ/LnfwnXU9F 50gAoIg5pzvAxaJN3rAbW4mDHY0wQ7o3 =AIk9 -----END PGP SIGNATURE----- --=-=-=--