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

[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



reply via email to

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