[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash 5a64259 218/316: ; Move -doto/--doto next to other
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dash 5a64259 218/316: ; Move -doto/--doto next to other threading macros |
Date: |
Mon, 15 Feb 2021 15:58:04 -0500 (EST) |
branch: externals/dash
commit 5a64259a35d6b5dd6f02693de51e8a61fb342a0c
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>
; Move -doto/--doto next to other threading macros
---
dash.el | 42 +++++++++++++++++++++---------------------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/dash.el b/dash.el
index be4fd4b..f0d56a9 100644
--- a/dash.el
+++ b/dash.el
@@ -62,27 +62,6 @@
(setq it-index (1+ it-index))
(!cdr ,l)))))
-(defmacro -doto (init &rest forms)
- "Evaluate INIT and pass it as argument to FORMS with `->'.
-The RESULT of evaluating INIT is threaded through each of FORMS
-individually using `->', which see. The return value is RESULT,
-which FORMS may have modified by side effect."
- (declare (debug (form body)) (indent 1))
- (let ((retval (make-symbol "result")))
- `(let ((,retval ,init))
- ,@(mapcar (lambda (form) `(-> ,retval ,form)) forms)
- ,retval)))
-
-(defmacro --doto (init &rest forms)
- "Anaphoric form of `-doto'.
-This just evaluates INIT, binds the result to `it', evaluates
-FORMS, and returns the final value of `it'.
-Note: `it' need not be used in each form."
- (declare (debug (form body)) (indent 1))
- `(let ((it ,init))
- ,@forms
- it))
-
(defun -each (list fn)
"Call FN with every item in LIST. Return nil, used for side-effects only."
(declare (indent 1))
@@ -1607,6 +1586,27 @@ and when that result is non-nil, through the next form,
etc."
(--> ,result ,form))
,@more))))
+(defmacro -doto (init &rest forms)
+ "Evaluate INIT and pass it as argument to FORMS with `->'.
+The RESULT of evaluating INIT is threaded through each of FORMS
+individually using `->', which see. The return value is RESULT,
+which FORMS may have modified by side effect."
+ (declare (debug (form body)) (indent 1))
+ (let ((retval (make-symbol "result")))
+ `(let ((,retval ,init))
+ ,@(mapcar (lambda (form) `(-> ,retval ,form)) forms)
+ ,retval)))
+
+(defmacro --doto (init &rest forms)
+ "Anaphoric form of `-doto'.
+This just evaluates INIT, binds the result to `it', evaluates
+FORMS, and returns the final value of `it'.
+Note: `it' need not be used in each form."
+ (declare (debug (form body)) (indent 1))
+ `(let ((it ,init))
+ ,@forms
+ it))
+
(defun -grade-up (comparator list)
"Grade elements of LIST using COMPARATOR relation, yielding a
permutation vector such that applying this permutation to LIST
- [elpa] externals/dash 0517ab1 185/316: Optimize -cycle a bit, (continued)
- [elpa] externals/dash 0517ab1 185/316: Optimize -cycle a bit, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 3950c48 189/316: ; Fix typo in version of recent obsoletion, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 8a33835 191/316: .gitignore: Ignore second dir-locals-file., ELPA Syncer, 2021/02/15
- [elpa] externals/dash ba3fb62 203/316: More README copy-edits, ELPA Syncer, 2021/02/15
- [elpa] externals/dash fbc9e31 197/316: Merge branch externals/dash from GNU ELPA, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 2fb97f0 202/316: ; Fix typo in last change, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 9c6a7c3 207/316: Add Makefile, ELPA Syncer, 2021/02/15
- [elpa] externals/dash f2cd73d 211/316: Make --dotimes more hygienic, ELPA Syncer, 2021/02/15
- [elpa] externals/dash b34ddf5 210/316: Improve formatting of ellipses, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 8879c41 216/316: Use actual dash-functional.el version in README, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 5a64259 218/316: ; Move -doto/--doto next to other threading macros,
ELPA Syncer <=
- [elpa] externals/dash b3c58ff 221/316: Fix docstring of -list, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 26f065f 129/316: Merge pull request #282 from yyoncho/anamorphic-doto, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 4abffdc 123/316: Update docs, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 677c156 134/316: Merge pull request #290 from leungbk/rotate, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 1549860 139/316: Merge pull request #296 from cireu/fix-hash-opt-expander, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 93e0465 137/316: Remove dependecy `macroexp`, ELPA Syncer, 2021/02/15
- [elpa] externals/dash a358b79 143/316: Speed up `-uniq` with hash-table., ELPA Syncer, 2021/02/15
- [elpa] externals/dash 77f3bf4 142/316: Merge pull request #302 from bbatsov/patch-1, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 38dc929 222/316: Fix, improve, and extend anaphoric folds, ELPA Syncer, 2021/02/15
- [elpa] externals/dash d308676 225/316: Fix signal argument and case where start is null, ELPA Syncer, 2021/02/15