From: Eli Zaretskii <eliz@gnu.org>
To: 31311@debbugs.gnu.org
Subject: bug#31311: 27.0; doc of `pcase'
Date: Thu, 24 May 2018 19:23:22 +0300 [thread overview]
Message-ID: <83lgc9aupx.fsf@gnu.org> (raw)
In-Reply-To: <87r2m22ndx.fsf@gnuvola.org> (message from Thien-Thi Nguyen on Wed, 23 May 2018 21:16:42 +0200)
> From: Thien-Thi Nguyen <ttn@gnu.org>
> Cc: Eli Zaretskii <eliz@gnu.org>
> Date: Wed, 23 May 2018 21:16:42 +0200
>
> > +@c Issue: Should this be split off into its own
> > node/subsection?
>
> Why is this important?
>
> It is important because ‘pcase’ 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 ‘let’-wrapped
> ‘cond’, 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 ‘cond’ CONDITION position".
The documentation of 'pcase' is inside Conditionals not because it
expands to 'cond', but because it can be perceived as a kind-of
generalization of 'cond' (and the current text even says so
explicitly).
> The last reason is that ‘pcase’ supports "sequencing patterns",
> i.e., ‘(and PAT...)’ and ‘(or PAT...)’. These are analogous to
> the same-named special forms documented in "Constructs for
> Combining Conditions" and the ‘pcase’ 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:
> - conditionals / four, ok, simple, no prob
> - combining conditions / two, old hat, no prob
> - pcase "sequencing conditions" / two, xref AH! like ‘and’, ‘or’
> 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).
I think you read too much into the tree-like structure of the manual,
in particular it sounds like you assume many people will read all the
sections of this chapter in strict depth-first order.
But that is not what happens in most use cases. People usually read
just the part(s) they need to understand the particular feature they
need to use in their programs. When read like this, the order matters
much less. What does matter is that details and "advanced" features
are at lower levels, so that first reading doesn't require people to
negotiate too many obstacles unnecessarily, which would prevent them
from easily grasping the higher-level picture and main ideas.
So I personally don't see too many serious reasons to promote this
subsection to the level of a section; quite the contrary. But neither
am I willing to make yet another dispute out of a minor issue such as
this. If you feel strongly about this, feel free to do it.
P.S. Your messages in this thread have a Mail-Followup-To header that
points back to the bug address, 31311@debbugs.gnu.org. This causes
Rmail to produce both To and CC headers to the bug address when I
reply, and I'm forced to manually remove one of them, which is an
annoyance. Would it be possible for you to avoid using that header,
please? TIA.
next prev parent reply other threads:[~2018-05-24 16:23 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-29 16:03 bug#31311: 27.0; doc of `pcase' Drew Adams
2018-04-29 16:39 ` Eli Zaretskii
2018-04-29 18:31 ` Michael Heerdegen
2018-04-29 18:45 ` Eli Zaretskii
2018-04-29 20:05 ` Michael Heerdegen
2018-04-30 2:36 ` Eli Zaretskii
2018-04-30 11:20 ` Noam Postavsky
2018-04-30 13:35 ` Thien-Thi Nguyen
2018-04-30 16:58 ` Drew Adams
2018-04-30 18:04 ` Michael Heerdegen
2018-05-01 9:41 ` Thien-Thi Nguyen
2018-04-30 19:31 ` Eli Zaretskii
2018-05-12 11:18 ` Thien-Thi Nguyen
2018-05-12 13:54 ` Michael Heerdegen
2018-05-15 14:24 ` Thien-Thi Nguyen
2018-05-15 15:16 ` Michael Heerdegen
2018-05-16 10:43 ` Thien-Thi Nguyen
2018-05-16 15:18 ` Michael Heerdegen
2018-05-20 18:59 ` Thien-Thi Nguyen
2018-05-23 13:55 ` Drew Adams
2018-05-23 15:42 ` Eli Zaretskii
2018-05-23 15:28 ` Eli Zaretskii
2018-05-23 19:16 ` Thien-Thi Nguyen
2018-05-24 16:23 ` Eli Zaretskii [this message]
2018-05-26 7:58 ` Thien-Thi Nguyen
2018-05-24 23:13 ` Noam Postavsky
2018-05-26 9:01 ` Thien-Thi Nguyen
2018-05-26 15:26 ` Drew Adams
2018-05-27 8:22 ` Thien-Thi Nguyen
2018-05-27 8:41 ` Thien-Thi Nguyen
2018-05-27 13:31 ` Drew Adams
2018-05-27 14:12 ` Noam Postavsky
2018-05-27 16:16 ` Eli Zaretskii
2018-05-27 16:26 ` Eli Zaretskii
2018-05-27 16:32 ` Andreas Schwab
2018-05-27 17:30 ` Eli Zaretskii
2018-05-27 17:45 ` Andreas Schwab
2018-05-27 17:42 ` Thien-Thi Nguyen
2018-05-28 7:25 ` Nicolas Petton
2018-05-28 7:33 ` Nicolas Petton
2018-05-28 8:27 ` Eli Zaretskii
2018-05-28 9:32 ` Nicolas Petton
2018-05-12 13:56 ` Noam Postavsky
2018-05-15 14:37 ` Thien-Thi Nguyen
2019-08-25 12:56 ` Michael Heerdegen
2018-04-30 14:28 ` Eli Zaretskii
2018-04-29 22:59 ` Drew Adams
2018-04-29 23:16 ` Noam Postavsky
2018-04-29 23:28 ` Drew Adams
2018-04-30 0:29 ` Michael Heerdegen
2018-04-30 2:47 ` Drew Adams
2018-04-30 7:48 ` Thien-Thi Nguyen
2018-05-21 17:04 ` Thien-Thi Nguyen
2022-04-29 13:48 ` Lars Ingebrigtsen
2022-04-29 14:39 ` Drew Adams
[not found] <<b5d5bbd5-f90c-4836-9307-7a74ad0b2320@default>
[not found] ` <<83wowqrmp8.fsf@gnu.org>
2018-04-29 17:02 ` Drew Adams
2018-04-29 17:16 ` Eli Zaretskii
2018-04-29 18:38 ` Michael Heerdegen
2018-04-29 19:43 ` Drew Adams
2018-04-29 20:00 ` Michael Heerdegen
[not found] <<<b5d5bbd5-f90c-4836-9307-7a74ad0b2320@default>
[not found] ` <<<83wowqrmp8.fsf@gnu.org>
[not found] ` <<9cd18e10-8f14-4a49-a3a4-ed9d50afe860@default>
[not found] ` <<83sh7erl01.fsf@gnu.org>
2018-04-29 17:26 ` Drew Adams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83lgc9aupx.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=31311@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).