emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Update of pcase docs for the elisp manual


From: Andy Moreton
Subject: Re: Update of pcase docs for the elisp manual
Date: Fri, 29 Jan 2016 13:39:59 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (windows-nt)

On Fri 29 Jan 2016, Eli Zaretskii wrote:
>
> I will make a few final corrections soon, based on these discussions,
> and then I'm done with that part of the manual.

Thanks for your efforts to improve the documentation.

In (info "(elisp) Pattern matching case statement") we currently have:

"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."

I think this would be clearer without the initial discussion of cond:

"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."

This gets straight to saying what pcase is useful for (and when cond is
sufficient for the task).


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.

    AndyM




reply via email to

[Prev in Thread] Current Thread [Next in Thread]