[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash 0f4cae9 249/439: Improve docs
From: |
Phillip Lord |
Subject: |
[elpa] externals/dash 0f4cae9 249/439: Improve docs |
Date: |
Tue, 04 Aug 2015 20:28:37 +0000 |
branch: externals/dash
commit 0f4cae956345b32b82d443d49ecb97f8b6375cc9
Author: Magnar Sveen <address@hidden>
Commit: Magnar Sveen <address@hidden>
Improve docs
---
README.md | 24 ++++++++++++------------
dev/examples.el | 23 ++++++++++++-----------
2 files changed, 24 insertions(+), 23 deletions(-)
diff --git a/README.md b/README.md
index 9439db1..e16cd06 100644
--- a/README.md
+++ b/README.md
@@ -464,7 +464,7 @@ Return the sum of `list`.
```cl
(-sum '()) ;; => 0
(-sum '(1)) ;; => 1
-(-sum '(1 2 3)) ;; => 6
+(-sum '(1 2 3 4)) ;; => 10
```
#### -product `(list)`
@@ -474,7 +474,7 @@ Return the product of `list`.
```cl
(-product '()) ;; => 1
(-product '(1)) ;; => 1
-(-product '(1 2 3)) ;; => 6
+(-product '(1 2 3 4)) ;; => 24
```
#### -min `(list)`
@@ -497,8 +497,8 @@ comparing them.
```cl
(-min-by '> '(4 3 6 1)) ;; => 1
-(-min-by '< '(4 3 6 1)) ;; => 6
-(--min-by (> (length it) (length other)) '((1 2 3) (1) (1 2))) ;; => '(1)
+(--min-by (> (car it) (car other)) '((1 2 3) (2) (3 2))) ;; => '(1 2 3)
+(--min-by (> (length it) (length other)) '((1 2 3) (2) (3 2))) ;; => '(2)
```
#### -max `(list)`
@@ -521,8 +521,8 @@ comparing them.
```cl
(-max-by '> '(4 3 6 1)) ;; => 6
-(--max-by (> (car it) (car other)) '((2 2 3) (3) (1 2))) ;; => '(3)
-(-max-by '< '(4 3 6 1)) ;; => 1
+(--max-by (> (car it) (car other)) '((1 2 3) (2) (3 2))) ;; => '(3 2)
+(--max-by (> (length it) (length other)) '((1 2 3) (2) (3 2))) ;; => '(1 2 3)
```
@@ -1064,9 +1064,9 @@ already. If there are more forms, inserts the first form
as the
second item in second form, etc.
```cl
-(-> "Abc") ;; => "Abc"
-(-> "Abc" (concat "def")) ;; => "Abcdef"
-(-> "Abc" (concat "def") (concat "ghi")) ;; => "Abcdefghi"
+(-> '(2 3 5)) ;; => '(2 3 5)
+(-> '(2 3 5) (append '(8 13))) ;; => '(2 3 5 8 13)
+(-> '(2 3 5) (append '(8 13)) (-slice 1 -1)) ;; => '(3 5 8)
```
#### ->> `(x form &rest more)`
@@ -1077,9 +1077,9 @@ already. If there are more forms, inserts the first form
as the
last item in second form, etc.
```cl
-(->> "Abc" (concat "def")) ;; => "defAbc"
-(->> "Abc" (concat "def") (concat "ghi")) ;; => "ghidefAbc"
-(->> 5 (- 8)) ;; => 3
+(->> '(1 2 3) (-map 'square)) ;; => '(1 4 9)
+(->> '(1 2 3) (-map 'square) (-remove 'even?)) ;; => '(1 9)
+(->> '(1 2 3) (-map 'square) (-reduce '+)) ;; => 14
```
#### --> `(x form &rest more)`
diff --git a/dev/examples.el b/dev/examples.el
index 84d72f8..64b0c9a 100644
--- a/dev/examples.el
+++ b/dev/examples.el
@@ -130,12 +130,12 @@
(defexamples -sum
(-sum '()) => 0
(-sum '(1)) => 1
- (-sum '(1 2 3)) => 6)
+ (-sum '(1 2 3 4)) => 10)
(defexamples -product
(-product '()) => 1
(-product '(1)) => 1
- (-product '(1 2 3)) => 6)
+ (-product '(1 2 3 4)) => 24)
(defexamples -min
(-min '(0)) => 0
@@ -144,8 +144,8 @@
(defexamples -min-by
(-min-by '> '(4 3 6 1)) => 1
- (-min-by '< '(4 3 6 1)) => 6
- (--min-by (> (length it) (length other)) '((1 2 3) (1) (1 2))) => '(1))
+ (--min-by (> (car it) (car other)) '((1 2 3) (2) (3 2))) => '(1 2 3)
+ (--min-by (> (length it) (length other)) '((1 2 3) (2) (3 2))) => '(2))
(defexamples -max
(-max '(0)) => 0
@@ -154,8 +154,8 @@
(defexamples -max-by
(-max-by '> '(4 3 6 1)) => 6
- (--max-by (> (car it) (car other)) '((2 2 3) (3) (1 2))) => '(3)
- (-max-by '< '(4 3 6 1)) => 1))
+ (--max-by (> (car it) (car other)) '((1 2 3) (2) (3 2))) => '(3 2)
+ (--max-by (> (length it) (length other)) '((1 2 3) (2) (3 2))) => '(1 2
3)))
(def-example-group "Predicates" nil
(defexamples -any?
@@ -406,15 +406,16 @@
(def-example-group "Threading macros" nil
(defexamples ->
- (-> "Abc") => "Abc"
- (-> "Abc" (concat "def")) => "Abcdef"
- (-> "Abc" (concat "def") (concat "ghi")) => "Abcdefghi"
+ (-> '(2 3 5)) => '(2 3 5)
+ (-> '(2 3 5) (append '(8 13))) => '(2 3 5 8 13)
+ (-> '(2 3 5) (append '(8 13)) (-slice 1 -1)) => '(3 5 8)
(-> 5 square) => 25
(-> 5 (+ 3) square) => 64)
(defexamples ->>
- (->> "Abc" (concat "def")) => "defAbc"
- (->> "Abc" (concat "def") (concat "ghi")) => "ghidefAbc"
+ (->> '(1 2 3) (-map 'square)) => '(1 4 9)
+ (->> '(1 2 3) (-map 'square) (-remove 'even?)) => '(1 9)
+ (->> '(1 2 3) (-map 'square) (-reduce '+)) => 14
(->> 5 (- 8)) => 3
(->> 5 (- 3) square) => 4)
- [elpa] externals/dash 6d20aa0 241/439: If has an indent function 2, not 1, (continued)
- [elpa] externals/dash 6d20aa0 241/439: If has an indent function 2, not 1, Phillip Lord, 2015/08/04
- [elpa] externals/dash 459322d 244/439: Update docs, Phillip Lord, 2015/08/04
- [elpa] externals/dash 9936885 245/439: Merge pull request #51 from Fuco1/debug-decl, Phillip Lord, 2015/08/04
- [elpa] externals/dash 38307e3 223/439: Partition docs, Phillip Lord, 2015/08/04
- [elpa] externals/dash bf99147 247/439: Fix `-tree-mapreduce-from` test & reformat the tests, Phillip Lord, 2015/08/04
- [elpa] externals/dash 75efb60 246/439: Add tree map/reduce, Phillip Lord, 2015/08/04
- [elpa] externals/dash e7bc8fe 250/439: Make dash-specific font lock optional, Phillip Lord, 2015/08/04
- [elpa] externals/dash 2ee84cb 251/439: Release 2.3.0, Phillip Lord, 2015/08/04
- [elpa] externals/dash f4ba8db 252/439: Add -snoc, Phillip Lord, 2015/08/04
- [elpa] externals/dash 9de1435 248/439: Merge pull request #53 from Fuco1/tree-stuff, Phillip Lord, 2015/08/04
- [elpa] externals/dash 0f4cae9 249/439: Improve docs,
Phillip Lord <=
- [elpa] externals/dash ec9afcb 255/439: Merge pull request #54 from Fuco1/index/modify, Phillip Lord, 2015/08/04
- [elpa] externals/dash d8ccf85 254/439: Add replace/update/remove functions for index/indices, Phillip Lord, 2015/08/04
- [elpa] externals/dash 3bbaed5 256/439: Release 2.4.0, Phillip Lord, 2015/08/04
- [elpa] externals/dash ab727ba 257/439: Correct anchors for links starting with '!', Phillip Lord, 2015/08/04
- [elpa] externals/dash 8052eb9 253/439: Merge pull request #55 from Fuco1/snoc, Phillip Lord, 2015/08/04
- [elpa] externals/dash 8005153 259/439: Add customize option to turn on font-lock for dash, Phillip Lord, 2015/08/04
- [elpa] externals/dash 7357283 258/439: Merge pull request #57 from Silex/master, Phillip Lord, 2015/08/04
- [elpa] externals/dash ba6e3c6 260/439: Add missing keywords, Phillip Lord, 2015/08/04
- [elpa] externals/dash ca9b296 263/439: Add Cask-file., Phillip Lord, 2015/08/04
- [elpa] externals/dash c788474 264/439: Fix bug with nested lists in `-remove-at-indices`, Phillip Lord, 2015/08/04