emacs-devel
[Top][All Lists]
Advanced

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

Re: Replace trivial pcase occurrences in the Emacs sources


From: Alan Mackenzie
Subject: Re: Replace trivial pcase occurrences in the Emacs sources
Date: Tue, 30 Oct 2018 18:14:34 +0000
User-agent: Mutt/1.10.1 (2018-07-13)

Hello, Clément.

On Tue, Oct 30, 2018 at 11:05:55 -0400, Clément Pit-Claudel wrote:
> On 30/10/2018 10.16, Andy Moreton wrote:
> > How are users meant to write reliable code using such constructs ?

> Ensure that the pattern actually matches :)

You mean, unless you can be 100% sure that the pattern will match, you
mustn't use pcase-... constructs.  That sounds equivalent to saying you
shouldn't use these constructs at all.

> IOW, only use these constructs when it's an invariant of your program
> that the pattern will match the data.  For cases in which the pattern
> might not match, use pcase instead of pcase-dolist.

pcase is not a looping construct.  pcase-dolist is.  They're not
replacements for eachother.

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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