[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash 1c2f43d 434/439: Add "See also" for the reduce fam
From: |
Phillip Lord |
Subject: |
[elpa] externals/dash 1c2f43d 434/439: Add "See also" for the reduce family |
Date: |
Tue, 04 Aug 2015 20:31:47 +0000 |
branch: externals/dash
commit 1c2f43d3793d3f2fcc3afe6d718db38bd157ec92
Author: Matus Goljer <address@hidden>
Commit: Matus Goljer <address@hidden>
Add "See also" for the reduce family
---
README.md | 8 ++++++++
dash.el | 16 ++++++++++++----
dash.texi | 8 ++++++++
3 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 763a8ae..8fca125 100644
--- a/README.md
+++ b/README.md
@@ -734,6 +734,8 @@ item, etc. If `list` contains no items, return
`initial-value` and
In the anaphoric form `--reduce-from`, the accumulated value is
exposed as `acc`.
+See also: [`-reduce`](#-reduce-fn-list), [`-reduce-r`](#-reduce-r-fn-list)
+
```el
(-reduce-from '- 10 '(1 2 3)) ;; => 4
(-reduce-from (lambda (memo item) (concat "(" memo " - " (int-to-string item)
")")) "10" '(1 2 3)) ;; => "(((10 - 1) - 2) - 3)"
@@ -749,6 +751,8 @@ returned and `fn` is not called.
Note: this function works the same as
[`-reduce-from`](#-reduce-from-fn-initial-value-list) but the
operation associates from right instead of from left.
+See also: [`-reduce-r`](#-reduce-r-fn-list), [`-reduce`](#-reduce-fn-list)
+
```el
(-reduce-r-from '- 10 '(1 2 3)) ;; => -8
(-reduce-r-from (lambda (item memo) (concat "(" (int-to-string item) " - "
memo ")")) "10" '(1 2 3)) ;; => "(1 - (2 - (3 - 10)))"
@@ -766,6 +770,8 @@ reduce return the result of calling `fn` with no arguments.
If
In the anaphoric form `--reduce`, the accumulated value is
exposed as `acc`.
+See also: [`-reduce-from`](#-reduce-from-fn-initial-value-list),
[`-reduce-r`](#-reduce-r-fn-list)
+
```el
(-reduce '- '(1 2 3 4)) ;; => -8
(-reduce (lambda (memo item) (format "%s-%s" memo item)) '(1 2 3)) ;; =>
"1-2-3"
@@ -786,6 +792,8 @@ accumulated value.
Note: this function works the same as [`-reduce`](#-reduce-fn-list) but the
operation
associates from right instead of from left.
+See also: [`-reduce-r-from`](#-reduce-r-from-fn-initial-value-list),
[`-reduce`](#-reduce-fn-list)
+
```el
(-reduce-r '- '(1 2 3 4)) ;; => -2
(-reduce-r (lambda (item memo) (format "%s-%s" memo item)) '(1 2 3)) ;; =>
"3-2-1"
diff --git a/dash.el b/dash.el
index 8a380b2..342d4a9 100644
--- a/dash.el
+++ b/dash.el
@@ -133,7 +133,9 @@ item, etc. If LIST contains no items, return INITIAL-VALUE
and
FN is not called.
In the anaphoric form `--reduce-from', the accumulated value is
-exposed as `acc`."
+exposed as `acc`.
+
+See also: `-reduce', `-reduce-r'"
(--reduce-from (funcall fn acc it) initial-value list))
(defmacro --reduce (form list)
@@ -153,7 +155,9 @@ reduce return the result of calling FN with no arguments. If
LIST has only 1 item, it is returned and FN is not called.
In the anaphoric form `--reduce', the accumulated value is
-exposed as `acc`."
+exposed as `acc`.
+
+See also: `-reduce-from', `-reduce-r'"
(if list
(-reduce-from fn (car list) (cdr list))
(funcall fn)))
@@ -164,7 +168,9 @@ the resulting expression. If LIST is empty, INITIAL-VALUE is
returned and FN is not called.
Note: this function works the same as `-reduce-from' but the
-operation associates from right instead of from left."
+operation associates from right instead of from left.
+
+See also: `-reduce-r', `-reduce'"
(if (not list) initial-value
(funcall fn (car list) (-reduce-r-from fn initial-value (cdr list)))))
@@ -184,7 +190,9 @@ The first argument of FN is the new item, the second is the
accumulated value.
Note: this function works the same as `-reduce' but the operation
-associates from right instead of from left."
+associates from right instead of from left.
+
+See also: `-reduce-r-from', `-reduce'"
(cond
((not list) (funcall fn))
((not (cdr list)) (car list))
diff --git a/dash.texi b/dash.texi
index 7dbdd2b..f566483 100644
--- a/dash.texi
+++ b/dash.texi
@@ -965,6 +965,8 @@ item, etc. If @var{list} contains no items, return
@var{initial-value} and
In the anaphoric form @code{--reduce-from}, the accumulated value is
exposed as `acc`.
+See also: @code{-reduce} (@pxref{-reduce}), @code{-reduce-r}
(@pxref{-reduce-r})
+
@example
@group
(-reduce-from '- 10 '(1 2 3))
@@ -990,6 +992,8 @@ returned and @var{fn} is not called.
Note: this function works the same as @code{-reduce-from}
(@pxref{-reduce-from}) but the
operation associates from right instead of from left.
+See also: @code{-reduce-r} (@pxref{-reduce-r}), @code{-reduce}
(@pxref{-reduce})
+
@example
@group
(-reduce-r-from '- 10 '(1 2 3))
@@ -1017,6 +1021,8 @@ reduce return the result of calling @var{fn} with no
arguments. If
In the anaphoric form @code{--reduce}, the accumulated value is
exposed as `acc`.
+See also: @code{-reduce-from} (@pxref{-reduce-from}), @code{-reduce-r}
(@pxref{-reduce-r})
+
@example
@group
(-reduce '- '(1 2 3 4))
@@ -1047,6 +1053,8 @@ accumulated value.
Note: this function works the same as @code{-reduce} (@pxref{-reduce}) but the
operation
associates from right instead of from left.
+See also: @code{-reduce-r-from} (@pxref{-reduce-r-from}), @code{-reduce}
(@pxref{-reduce})
+
@example
@group
(-reduce-r '- '(1 2 3 4))
- [elpa] externals/dash 45bd985 427/439: Reimplementation of --group-by., (continued)
- [elpa] externals/dash 45bd985 427/439: Reimplementation of --group-by., Phillip Lord, 2015/08/04
- [elpa] externals/dash aa13c07 429/439: fixed typo in docs (first where it should be last, Phillip Lord, 2015/08/04
- [elpa] externals/dash 70caa37 432/439: Merge pull request #144 from cammsaul/thread_last_make_second_arg_optional, Phillip Lord, 2015/08/04
- [elpa] externals/dash 1677338 428/439: Merge pull request #138 from phillord/fix/group-by-write-out, Phillip Lord, 2015/08/04
- [elpa] externals/dash e468937 435/439: Formatting, Phillip Lord, 2015/08/04
- [elpa] externals/dash 89abffe 437/439: Make it explicit that not all VALS are evalled in -if-let*, Phillip Lord, 2015/08/04
- [elpa] externals/dash b88cfb7 436/439: Add dash prefix to epsilon variable., Phillip Lord, 2015/08/04
- [elpa] externals/dash eadb265 439/439: Swap examples to better show how -some-> works, Phillip Lord, 2015/08/04
- [elpa] externals/dash 2aeeacb 433/439: Release 2.11.0, Phillip Lord, 2015/08/04
- [elpa] externals/dash c3cf98d 438/439: Add `-some->`, `-some->>`, and `-some-->` macros., Phillip Lord, 2015/08/04
- [elpa] externals/dash 1c2f43d 434/439: Add "See also" for the reduce family,
Phillip Lord <=
- [elpa] externals/dash 2b69c14 411/439: Add dash.info and dash.texi to repo, Phillip Lord, 2015/08/04
- [elpa] externals/dash e574465 404/439: Add `-some`, Phillip Lord, 2015/08/04
- [elpa] externals/dash 4640a2a 405/439: Allow for approx comparison of floats in tests, Phillip Lord, 2015/08/04
- [elpa] externals/dash 3b63476 412/439: Move anaphoric function intro up into Functions section, Phillip Lord, 2015/08/04
- [elpa] externals/dash 19fbc24 426/439: Fix anaphoric -spice-list macro, Phillip Lord, 2015/08/04
- [elpa] externals/dash 2db56f5 424/439: [-let] Add support for &as bindings (#115), Phillip Lord, 2015/08/04
- [elpa] externals/dash ffa37bf 425/439: Merge pull request #129 from holomorph/docs, Phillip Lord, 2015/08/04
- [elpa] externals/dash 81b808d 409/439: Ignore dash.elc, Phillip Lord, 2015/08/04
- [elpa] externals/dash c61113b 420/439: [-let] Update outdated comment, Phillip Lord, 2015/08/04
- [elpa] externals/dash 733274f 398/439: Merge pull request #120 from holomorph/info-manual, Phillip Lord, 2015/08/04