all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andy Moreton <andrewjmoreton@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: Update of pcase docs for the elisp manual
Date: Fri, 29 Jan 2016 15:14:17 +0000	[thread overview]
Message-ID: <vz14mdwmn92.fsf@gmail.com> (raw)
In-Reply-To: 83powkxy7s.fsf@gnu.org

On Fri 29 Jan 2016, Eli Zaretskii wrote:

>> From: Andy Moreton <andrewjmoreton@gmail.com>
>> Date: Fri, 29 Jan 2016 13:39:59 +0000
>> 
>> This gets straight to saying what pcase is useful for (and when cond is
>> sufficient for the task).
>
> I obviously disagree, or else I wouldn't have written that in the
> first place.
>
> I think 'pcase' deserves a rationale, and contrasting it with another
> similar facility is a good way of presenting that rationale, and at
> the same time making the point that 'pcase' shouldn't be used where
> 'cond' can do the job, something that came up in the recent
> discussions.

Fair enough. Please consider starting a new paragraph though:

"The ‘cond’ form lets you choose between alternatives using predicate
conditions that compare values of expressions against specific values
known and written in advance.  However, sometimes it is useful to select
alternatives based on more general conditions that distinguish between
broad classes of values.

The ‘pcase’ macro allows you to choose between alternatives based on
matching the value of an expression against a series of patterns. A
pattern can be a literal value (for comparisons to literal values you’d
use ‘cond’), or it can be a more general description of the expected
structure of the expression’s value."

>> Also, the description of CLAUSES for pcase and cond in the manual use:
>>   pcase:  (PATTERN BODY-FORMS…)
>>   cond:   (CONDITION BODY-FORMS…)
>> 
>> However the doc strings are inconsistent with the manual:
>>   pcase:  (PATTERN CODE...)
>>   cond:   (CONDITION BODY...)
>> 
>> It would be better to use consistent terms.
>
> Blame those who wrote the doc strings ;-)

I sought improvement, not blame :-)

    AndyM




  reply	other threads:[~2016-01-29 15:14 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m2fuxq6pb0.fsf@newartisans.com>
     [not found] ` <87d1stznc6.fsf@web.de>
     [not found]   ` <m2si1p8r31.fsf@newartisans.com>
     [not found]     ` <m2powt5w50.fsf@newartisans.com>
2016-01-23 11:17       ` Update of pcase docs for the elisp manual Eli Zaretskii
2016-01-24  4:40         ` Stefan Monnier
2016-01-24 14:33           ` Eli Zaretskii
2016-01-24 23:17             ` Stefan Monnier
2016-01-25 16:14               ` Eli Zaretskii
2016-01-26  1:40                 ` Stefan Monnier
2016-01-26 15:38                   ` Eli Zaretskii
2016-01-26 16:23                     ` Stefan Monnier
2016-01-25 14:22             ` Michael Heerdegen
2016-01-25 14:15         ` Michael Heerdegen
2016-01-25 16:33           ` Eli Zaretskii
2016-01-28 18:37             ` Michael Heerdegen
2016-01-29  3:06               ` Stefan Monnier
2016-01-29  9:45               ` Eli Zaretskii
2016-01-29 14:51                 ` Michael Heerdegen
2016-01-26 16:59         ` John Wiegley
2016-01-26 18:10           ` Stefan Monnier
2016-01-26 18:41           ` Eli Zaretskii
2016-01-26 19:35             ` John Wiegley
2016-01-26 20:28               ` Eli Zaretskii
2016-01-29  1:28                 ` John Wiegley
2016-01-29  8:30                   ` Eli Zaretskii
2016-01-29 13:39                     ` Andy Moreton
2016-01-29 14:21                       ` Eli Zaretskii
2016-01-29 15:14                         ` Andy Moreton [this message]
2016-01-29 15:37                           ` Eli Zaretskii
2016-01-26 19:58             ` Andy Moreton
2016-01-26 20:19               ` Eli Zaretskii

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=vz14mdwmn92.fsf@gmail.com \
    --to=andrewjmoreton@gmail.com \
    --cc=emacs-devel@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 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.