[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
- [elpa] externals/dash b4ab366 194/316: Merge pull request #355 from blc/info, (continued)
- [elpa] externals/dash b4ab366 194/316: Merge pull request #355 from blc/info, ELPA Syncer, 2021/02/15
- [elpa] externals/dash e8ed3d6 196/316: * watch-tests.watchr: Remove file., ELPA Syncer, 2021/02/15
- [elpa] externals/dash 814c407 198/316: * dev/.nosearch: Document file's purpose., ELPA Syncer, 2021/02/15
- [elpa] externals/dash 018d30c 200/316: Update all library headers for 2021, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 2200db0 204/316: Various Texinfo manual improvements, ELPA Syncer, 2021/02/15
- [elpa] externals/dash e8cc2ec 205/316: Merge pull request #358 from blc/texi, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 2a94ea5 209/316: Remove unnecessary helper function, ELPA Syncer, 2021/02/15
- [elpa] externals/dash adf3a0d 208/316: Merge pull request #359 from blc/make, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 1d58249 212/316: Write -iterate in terms of --iterate, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 47f8b2b 214/316: Clean up -doto, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 794bf8c 219/316: ; Fix omission in last change,
ELPA Syncer <=
- [elpa] externals/dash f9d67ae 223/316: Merge pull request #314 from blc/reductions, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 31a655b 224/316: Fix -cons* with no arguments, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 3423be4 227/316: Merge pull request #364 from blc/info-look, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 558cd95 230/316: Fix take/drop splits (again), ELPA Syncer, 2021/02/15
- [elpa] externals/dash f975634 233/316: Merge pull request #235, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 8248997 234/316: Merge pull request #207 from holomorph/iota, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 3694ae9 236/316: * dash.el (-iota): Simplify and purify., ELPA Syncer, 2021/02/15
- [elpa] externals/dash ca36c57 239/316: Allow -lambda with no arguments, ELPA Syncer, 2021/02/15
- [elpa] externals/dash bf8a462 243/316: Partially revert last change, ELPA Syncer, 2021/02/15
- [elpa] externals/dash d7d0acb 242/316: Don't call eval, ELPA Syncer, 2021/02/15