[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)
- [elpa] externals/dash eb50d17 106/426: Add Melpa back in., (continued)
- [elpa] externals/dash eb50d17 106/426: Add Melpa back in., Phillip Lord, 2015/08/04
- [elpa] externals/dash 0e5c69b 089/426: Docs: more concise example for anaphoric functions., Phillip Lord, 2015/08/04
- [elpa] externals/dash 03370ea 108/426: Simplify examples-to-docs and examples-to-tests with dash, Phillip Lord, 2015/08/04
- [elpa] externals/dash ba80875 109/426: Nice indentation for --each, --each-while and --dotimes, Phillip Lord, 2015/08/04
- [elpa] externals/dash f1c8453 083/426: Rename to dash., Phillip Lord, 2015/08/04
- [elpa] externals/dash 51ddc13 110/426: Nice indentation for threading macros., Phillip Lord, 2015/08/04
- [elpa] externals/dash ba60707 103/426: Use --each-while to simplify implementations., Phillip Lord, 2015/08/04
- [elpa] externals/dash c56925a 111/426: Add font-lock for new functions and the `it` token., Phillip Lord, 2015/08/04
- [elpa] externals/dash a081c72 114/426: Fix tests., Phillip Lord, 2015/08/04
- [elpa] externals/dash a336d78 112/426: Add -only-some?, Phillip Lord, 2015/08/04
- [elpa] externals/dash 81a3247 104/426: Let -each and -each-while take multiple forms.,
Phillip Lord <=
- [elpa] externals/dash d857f73 118/426: Merge pull request #3 from rejeep/join-alias, Phillip Lord, 2015/08/04
- [elpa] externals/dash 9faa422 115/426: Add -partition-by, Phillip Lord, 2015/08/04
- [elpa] externals/dash f034c16 119/426: Add -union (thanks to @Fuco1), Phillip Lord, 2015/08/04
- [elpa] externals/dash 9a3dfdd 113/426: Name parameter PRED when function expects predicate., Phillip Lord, 2015/08/04
- [elpa] externals/dash cca9b1b 121/426: Also run tests on Emacs24, Phillip Lord, 2015/08/04
- [elpa] externals/dash c669282 123/426: Add @Fuco1 to list of contributors., Phillip Lord, 2015/08/04
- [elpa] externals/dash 12ed9f6 100/426: Add destructive operations !cons og !cdr, Phillip Lord, 2015/08/04
- [elpa] externals/dash c025efb 122/426: Add -separate (thanks @Fuco1), Phillip Lord, 2015/08/04
- [elpa] externals/dash 2c5b86e 117/426: Add -join as alias to -distinct., Phillip Lord, 2015/08/04
- [elpa] externals/dash 1c4e5d7 125/426: Remove eval from --reduce, it is evil., Phillip Lord, 2015/08/04