[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: Clément Pit-Claudel
Subject: Re: Replace trivial pcase occurrences in the Emacs sources
Date: Thu, 1 Nov 2018 11:28:20 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1

On 01/11/2018 10.44, Andy Moreton wrote:
> The difference is that the non-pcase constructs can document exactly
> which types are acceptable as arguments. For the pcase macros, the
> acceptable argument types are not fixed by the pcase macro, but depend
> on the patterns used. That is harder to explain clearly, and harder for
> the user to reason about correctness of the code that they write.

Thanks, I see what you mean (though it soujnds more like a general indictment 
of pcase, not just of the "fail silently" behavior of pcase-*). Conversely, 
though, you could argue that documenting exactly which data are acceptable is 
precisely what the patterns passed to pcase-let do: if I write `(pcase-let* 
((`(,a . ,b) xyz)) …)`, I'm specifying that `xyz' should be a cons.

reply via email to

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