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: Stefan Monnier
Subject: Re: Replace trivial pcase occurrences in the Emacs sources
Date: Tue, 30 Oct 2018 13:27:43 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> Seriously?  This cannot fly: for starters, the user could be using an
> Emacs where *.el files are not accessible.

I didn't mean for the docstring to say "read the code"; I meant the
patch below.

> Tell you what: how about if you try explaining this,

I already did.


        Stefan


diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el
index 57c2d6c3cb..7781d0d424 100644
--- a/lisp/emacs-lisp/pcase.el
+++ b/lisp/emacs-lisp/pcase.el
@@ -302,7 +302,10 @@ pcase-let
 
 ;;;###autoload
 (defmacro pcase-dolist (spec &rest body)
-  "Like `dolist' but where the binding can be a `pcase' pattern.
+  "Superset of `dolist' where the VAR binding can be a `pcase' PATTERN.
+More specifically, this is just a shorthand for
+
+    (dolist (x LIST) (pcase-let ((PATTERN x)) BODY...))
 \n(fn (PATTERN LIST) BODY...)"
   (declare (indent 1) (debug ((pcase-PAT form) body)))
   (if (pcase--trivial-upat-p (car spec))




reply via email to

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