[Top][All Lists]

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

Re: Replace trivial pcase occurrences in the Emacs sources

From: Eric Abrahamsen
Subject: Re: Replace trivial pcase occurrences in the Emacs sources
Date: Mon, 29 Oct 2018 16:12:45 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Michael Heerdegen <address@hidden> writes:

> Stefan Monnier <address@hidden> writes:
>> I'd rather keep it defined in terms of its differences w.r.t `dolist`,
>> but if really needed, we could change the doc so it doesn't rely on
>> `dolist`s own doc at all.
> I also don't think that would be an improvement.
>> +As in the case of `pcase-let', PATTERN is matched under the
>> assumption +that it *will* match.
> What this leaves a bit unclear: It sounds like matching itself happens
> differently (user visibly).  Or does it just mean "if PATTERN doesn't
> match, the behavior [of pcase-dolist] is undefined/ this is not
> allowed".

I wonder if the manual shouldn't have a section somewhere making
explicit the difference between `pcase' -- where a single value is
matched against many patterns, and may fail to match altogether, and
destructuring is only one of the use-cases -- and the other
pcase-derived forms, where many values are matched against a single
pattern, which *must* match (or error), and destructuring is kind of the
whole point. Conceptually, they're pretty different.

BTW I just looked at the new manual section for pcase -- that's much


reply via email to

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