[Top][All Lists]

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

Re: Clarify `pcase' `rx' pattern doc

From: Yuri Khan
Subject: Re: Clarify `pcase' `rx' pattern doc
Date: Wed, 13 Jun 2018 19:29:29 +0700

On Wed, Jun 13, 2018 at 3:22 PM Michael Heerdegen
<address@hidden> wrote:

> BTW this aspect concerns more or less all pcase pattern definitions: The
> first sentence either is not a sentence in the strict sense, or says
> "Build a pcase pattern matching..."  We should probably unify the
> language used.

The standard patterns are documented in this form:

    <pattern> matches <something in some conditions>.

It would be nice if extended patterns defined using pcase-defmacro
also followed this syntax:

    -- (seq &rest PATTERNS)

    Matches a SEQUENCE such that each element of PATTERNS matches a
corresponding element of SEQUENCE.

    Extra elements of the sequence are ignored if fewer PATTERNS are
given, and the match does not fail.

In other words, for the user, it is not important that underlying the
‘(seq …)’ is a ‘seq--pcase-macroexpander’ function that builds a pcase
pattern out of simpler constructs. From the user’s viewpoint, ‘(seq
…)’ *is* the pattern.

reply via email to

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