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

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

[elpa] externals/dash 794bf8c 219/316: ; Fix omission in last change


From: ELPA Syncer
Subject: [elpa] externals/dash 794bf8c 219/316: ; Fix omission in last change
Date: Mon, 15 Feb 2021 15:58:04 -0500 (EST)

branch: externals/dash
commit 794bf8c03ffd445455978699771f52593e03e201
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>

    ; Fix omission in last change
    
    Also move examples/tests for -doto under "Threading macros".
---
 README.md       | 28 ++++++++++++++--------------
 dash.texi       | 46 +++++++++++++++++++++++-----------------------
 dev/examples.el | 16 ++++++++--------
 3 files changed, 45 insertions(+), 45 deletions(-)

diff --git a/README.md b/README.md
index 929860c..c8baacf 100644
--- a/README.md
+++ b/README.md
@@ -299,6 +299,7 @@ Functions pretending lists are trees.
 * [-some->](#-some--x-optional-form-rest-more) `(x &optional form &rest more)`
 * [-some->>](#-some--x-optional-form-rest-more) `(x &optional form &rest more)`
 * [-some-->](#-some---x-optional-form-rest-more) `(x &optional form &rest 
more)`
+* [-doto](#-doto-init-rest-forms) `(init &rest forms)`
 
 ### Binding
 
@@ -325,7 +326,6 @@ Functions iterating over lists for side-effect only.
 * [-each-r](#-each-r-list-fn) `(list fn)`
 * [-each-r-while](#-each-r-while-list-pred-fn) `(list pred fn)`
 * [-dotimes](#-dotimes-num-fn) `(num fn)`
-* [-doto](#-doto-init-rest-forms) `(init &rest forms)`
 
 ### Destructive operations
 
@@ -2269,6 +2269,19 @@ and when that result is non-nil, through the next form, 
etc.
 (-some--> '(1 3 5) (-filter 'even? it) (append it it) (-map 'square it)) ;; => 
nil
 ```
 
+#### -doto `(init &rest forms)`
+
+Evaluate `init` and pass it as argument to `forms` with 
[`->`](#--x-optional-form-rest-more).
+The `result` of evaluating `init` is threaded through each of `forms`
+individually using [`->`](#--x-optional-form-rest-more), which see.  The 
return value is `result`,
+which `forms` may have modified by side effect.
+
+```el
+(-doto (list 1 2 3) pop pop) ;; => '(3)
+(-doto (cons 1 2) (setcar 3) (setcdr 4)) ;; => '(3 . 4)
+(gethash 'k (--doto (make-hash-table) (puthash 'k 'v it))) ;; => 'v
+```
+
 
 ## Binding
 
@@ -2648,19 +2661,6 @@ if `num` is less than 1.
 (let (s) (--dotimes 5 (push it s)) s) ;; => '(4 3 2 1 0)
 ```
 
-#### -doto `(init &rest forms)`
-
-Evaluate `init` and pass it as argument to `forms` with 
[`->`](#--x-optional-form-rest-more).
-The `result` of evaluating `init` is threaded through each of `forms`
-individually using [`->`](#--x-optional-form-rest-more), which see.  The 
return value is `result`,
-which `forms` may have modified by side effect.
-
-```el
-(-doto (list 1 2 3) pop pop) ;; => '(3)
-(-doto (cons 1 2) (setcar 3) (setcdr 4)) ;; => '(3 . 4)
-(gethash 'k (--doto (make-hash-table) (puthash 'k 'v it))) ;; => 'v
-```
-
 
 ## Destructive operations
 
diff --git a/dash.texi b/dash.texi
index 0e5aa86..c3f0bff 100644
--- a/dash.texi
+++ b/dash.texi
@@ -3513,6 +3513,29 @@ and when that result is non-nil, through the next form, 
etc.
 @end example
 @end defmac
 
+@anchor{-doto}
+@defmac -doto (init &rest forms)
+Evaluate @var{init} and pass it as argument to @var{forms} with @code{->} 
(@pxref{->}).
+The @var{result} of evaluating @var{init} is threaded through each of 
@var{forms}
+individually using @code{->} (@pxref{->}), which see.  The return value is 
@var{result},
+which @var{forms} may have modified by side effect.
+
+@example
+@group
+(-doto (list 1 2 3) pop pop)
+    @result{} '(3)
+@end group
+@group
+(-doto (cons 1 2) (setcar 3) (setcdr 4))
+    @result{} '(3 . 4)
+@end group
+@group
+(gethash 'k (--doto (make-hash-table) (puthash 'k 'v it)))
+    @result{} 'v
+@end group
+@end example
+@end defmac
+
 
 @node Binding
 @section Binding
@@ -4024,29 +4047,6 @@ if @var{num} is less than 1.
 @end example
 @end defun
 
-@anchor{-doto}
-@defmac -doto (init &rest forms)
-Evaluate @var{init} and pass it as argument to @var{forms} with @code{->} 
(@pxref{->}).
-The @var{result} of evaluating @var{init} is threaded through each of 
@var{forms}
-individually using @code{->} (@pxref{->}), which see.  The return value is 
@var{result},
-which @var{forms} may have modified by side effect.
-
-@example
-@group
-(-doto (list 1 2 3) pop pop)
-    @result{} '(3)
-@end group
-@group
-(-doto (cons 1 2) (setcar 3) (setcdr 4))
-    @result{} '(3 . 4)
-@end group
-@group
-(gethash 'k (--doto (make-hash-table) (puthash 'k 'v it)))
-    @result{} 'v
-@end group
-@end example
-@end defmac
-
 
 @node Destructive operations
 @section Destructive operations
diff --git a/dev/examples.el b/dev/examples.el
index 067ef47..c0bb494 100644
--- a/dev/examples.el
+++ b/dev/examples.el
@@ -1067,7 +1067,13 @@ consuming a list to produce a single value."
     (-some--> "def" (concat "abc" it "ghi")) => "abcdefghi"
     (-some--> nil (concat "abc" it "ghi")) => nil
     (-some--> '(1 3 5) (-filter 'even? it) (append it it) (-map 'square it)) 
=> nil
-    (-some--> '(2 4 6) (-filter 'even? it) (append it it) (-map 'square it)) 
=> '(4 16 36 4 16 36)))
+    (-some--> '(2 4 6) (-filter 'even? it) (append it it) (-map 'square it)) 
=> '(4 16 36 4 16 36))
+
+  (defexamples -doto
+    (-doto (list 1 2 3) pop pop) => '(3)
+    (-doto (cons 1 2) (setcar 3) (setcdr 4)) => '(3 . 4)
+    (gethash 'k (--doto (make-hash-table) (puthash 'k 'v it))) => 'v
+    (-doto (cons 1 2)) => '(1 . 2)))
 
 (def-example-group "Binding"
   "Convenient versions of `let` and `let*` constructs combined with flow 
control."
@@ -1362,13 +1368,7 @@ consuming a list to produce a single value."
     (let (s) (-dotimes 0 (lambda (n) (push n s))) s) => ()
     (let (s) (--dotimes 5 (push it s)) s) => '(4 3 2 1 0)
     (let (s) (--dotimes 0 (push it s)) s) => ()
-    (let (s) (--dotimes 3 (push it s) (setq it -1)) s) => '(2 1 0))
-
-  (defexamples -doto
-    (-doto (list 1 2 3) pop pop) => '(3)
-    (-doto (cons 1 2) (setcar 3) (setcdr 4)) => '(3 . 4)
-    (gethash 'k (--doto (make-hash-table) (puthash 'k 'v it))) => 'v
-    (-doto (cons 1 2)) => '(1 . 2)))
+    (let (s) (--dotimes 3 (push it s) (setq it -1)) s) => '(2 1 0)))
 
 (def-example-group "Destructive operations" nil
   (defexamples !cons



reply via email to

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