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: Andy Moreton
Subject: Re: Replace trivial pcase occurrences in the Emacs sources
Date: Tue, 30 Oct 2018 14:16:59 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt)

On Tue 30 Oct 2018, Stefan Monnier wrote:

>> I think the doc string should be (more) independent, at least in the
>> pcase-dolist case, because the semantics of executing BODY with
>> PATTERN matched against a LIST element is significantly different from
>> that of executing the dolist BODY with a VAR binding.
>
> Hmm... I really don't see what difference you're thinking of.
>
> Maybe a simpler way to document it is to show its definition:
>
>     (dolist (x LIST) (pcase-let ((PATTERN x)) BODY))

So this also fails randomly if the pattern does not match, like
`pcase-let', and this should be documented.

How are users meant to write reliable code using such constructs ? Why
are there not versions of these constructs that have deterministic
behaviour on pattern match failure ?

    AndyM




reply via email to

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