all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thien-Thi Nguyen <ttn@gnu.org>
To: Drew Adams <drew.adams@oracle.com>
Cc: 31311@debbugs.gnu.org
Subject: bug#31311: 27.0; doc of `pcase'
Date: Mon, 30 Apr 2018 09:48:15 +0200	[thread overview]
Message-ID: <87k1sp5e4g.fsf@gnuvola.org> (raw)
In-Reply-To: <f24c2362-c9f4-49d2-9860-03374ddc85bb@default> (Drew Adams's message of "Sun, 29 Apr 2018 19:47:08 -0700 (PDT)")

[-- Attachment #1: Type: text/plain, Size: 2167 bytes --]


() Drew Adams <drew.adams@oracle.com>
() Sun, 29 Apr 2018 19:47:08 -0700 (PDT)

   > > 2. Don't use ATOM [...]
   > 
   > "ATOM can be a keyword, an integer, or a string".  In
   > particular, floats are excluded.  nil and t are also
   > excluded.  "KEYWORD-OR-INTEGER-OR-STRING" is not a good
   > name, however.

   It may not be a good name, but it is not so misleading.  And
   it's not used in a zillion places, so it's not a big deal if
   the name is long: INTEGER-STRING-OR-KEYWORD or even perhaps
   INTEGER|STRING|KEYWORD.  We have much longer stuff in the
   description of font-lock stuff and elsewhere.  Complex things
   need careful breakdowns and named parts.

   "Atom", without that qualification, includes lots of other
   things, including vectors and, in particular, symbols.

Since "atom" is a shorthand for this set of types in an @item
context, another solution is to list the types explicitly:

 @item @var{integer}
 @itemx @var{string}
 @itemx @var{keyword}

 These types are self-quoting [...]

In this way, we achieve grouping through presentation and not
through coining (possibly confusing) terms.  This makes the text
longer vertically, but flattens the conceptual model (for this
particular grouping of types) for the reader, who can mentally
coin terms on their own, like "!@#$%-complicated-sh*t".  :-D

   Oh, and do the other two occurrences of ATOM - those in the
   description of Q-patterns - mean the same thing: keyword,
   string, or integer?  Nothing said about that; not clear.

Same technique applicable, here.  Generally, it's good to use
abstractions in code (DRY principle), but for documentation, a
flatter landscape w/ simple landmarks is easier to navigate.

This is one of the sadnesses i have come to realize as a
programmer trying to communicate w/ non-programmers.

-- 
Thien-Thi Nguyen -----------------------------------------------
 (defun responsep (query)
   (pcase (context query)
     (`(technical ,ml) (correctp ml))
     ...))                              748E A0E8 1CB8 A748 9BFA
--------------------------------------- 6CE4 6703 2224 4C80 7502


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2018-04-30  7:48 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
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 [this message]
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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k1sp5e4g.fsf@gnuvola.org \
    --to=ttn@gnu.org \
    --cc=31311@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.