emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/dash 81a3247 104/426: Let -each and -each-while take mu


From: Phillip Lord
Subject: [elpa] externals/dash 81a3247 104/426: Let -each and -each-while take multiple forms.
Date: Tue, 04 Aug 2015 19:37:00 +0000

branch: externals/dash
commit 81a3247609d736646fc4fe6ccbb346936e1f88d1
Author: Magnar Sveen <address@hidden>
Commit: Magnar Sveen <address@hidden>

    Let -each and -each-while take multiple forms.
---
 dash.el |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dash.el b/dash.el
index 0a167ce..7a81131 100644
--- a/dash.el
+++ b/dash.el
@@ -35,20 +35,20 @@
   "Destructive: Sets LIST to the cdr of LIST."
   `(setq ,list (cdr ,list)))
 
-(defmacro --each (list form)
+(defmacro --each (list &rest body)
   "Anaphoric form of `-each'."
   (let ((l (make-symbol "list")))
     `(let ((,l ,list))
        (while ,l
          (let ((it (car ,l)))
-           ,form)
+           ,@body)
          (!cdr ,l)))))
 
 (defun -each (list fn)
   "Calls FN with every item in LIST. Returns nil, used for side-effects only."
   (--each list (funcall fn it)))
 
-(defmacro --each-while (list pred form)
+(defmacro --each-while (list pred &rest body)
   "Anaphoric form of `-each-while'."
   (let ((l (make-symbol "list"))
         (c (make-symbol "continue")))
@@ -56,7 +56,7 @@
            (,c t))
        (while (and ,l ,c)
          (let ((it (car ,l)))
-           (if ,pred ,form (setq ,c nil)))
+           (if (not ,pred) (setq ,c nil) ,@body))
          (!cdr ,l)))))
 
 (defun -each-while (list pred fn)



reply via email to

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