[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash 8707aaf 367/439: Update docs
From: |
Phillip Lord |
Subject: |
[elpa] externals/dash 8707aaf 367/439: Update docs |
Date: |
Tue, 04 Aug 2015 20:30:36 +0000 |
branch: externals/dash
commit 8707aafd9608809d5366859d9e5c51b1e7d8a9d4
Author: Fredrik Bergroth <address@hidden>
Commit: Fredrik Bergroth <address@hidden>
Update docs
---
README.md | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 35bf929..3b89a12 100644
--- a/README.md
+++ b/README.md
@@ -1663,17 +1663,21 @@ Convenient versions of `let` and `let*` constructs
combined with flow control.
If `val` evaluates to non-nil, bind it to `var` and execute body.
`var-val` should be a (`var` `val`) pair.
+Note: binding is done according to `-let`.
+
```cl
(-when-let (match-index (string-match "d" "abcd")) (+ match-index 2)) ;; => 5
-(--when-let (member :b '(:a :b :c)) (cons :d it)) ;; => '(:d :b :c)
-(--when-let (even? 3) (cat it :a)) ;; => nil
+(-when-let ((&plist :foo foo) (list :foo "foo")) foo) ;; => "foo"
+(-when-let ((&plist :foo foo) (list :bar "bar")) foo) ;; => nil
```
#### -when-let* `(vars-vals &rest body)`
If all `vals` evaluate to true, bind them to their corresponding
`vars` and execute body. `vars-vals` should be a list of (`var` `val`)
-pairs (corresponding to bindings of `let*`).
+pairs.
+
+Note: binding is done according to `-let`.
```cl
(-when-let* ((x 5) (y 3) (z (+ y 4))) (+ x y z)) ;; => 15
@@ -1685,6 +1689,8 @@ pairs (corresponding to bindings of `let*`).
If `val` evaluates to non-nil, bind it to `var` and do `then`,
otherwise do `else`. `var-val` should be a (`var` `val`) pair.
+Note: binding is done according to `-let`.
+
```cl
(-if-let (match-index (string-match "d" "abc")) (+ match-index 3) 7) ;; => 7
(--if-let (even? 4) it nil) ;; => t
@@ -1694,11 +1700,14 @@ otherwise do `else`. `var-val` should be a (`var`
`val`) pair.
If all `vals` evaluate to true, bind them to their corresponding
`vars` and do `then`, otherwise do `else`. `vars-vals` should be a list
-of (`var` `val`) pairs (corresponding to the bindings of `let*`).
+of (`var` `val`) pairs.
+
+Note: binding is done according to `-let`.
```cl
(-if-let* ((x 5) (y 3) (z 7)) (+ x y z) "foo") ;; => 15
(-if-let* ((x 5) (y nil) (z 7)) (+ x y z) "foo") ;; => "foo"
+(-if-let* (((_ _ x) '(nil nil 7))) x) ;; => 7
```
#### -let `(varlist &rest body)`
- [elpa] externals/dash 40849a7 357/439: [-let] Remove stale comment, (continued)
- [elpa] externals/dash 40849a7 357/439: [-let] Remove stale comment, Phillip Lord, 2015/08/04
- [elpa] externals/dash edb1e31 356/439: [-let] Add more tests, Phillip Lord, 2015/08/04
- [elpa] externals/dash 4b63be1 362/439: Declare --mapcat macro before using it. #102, Phillip Lord, 2015/08/04
- [elpa] externals/dash 31f321a 358/439: Release 2.9.0, Phillip Lord, 2015/08/04
- [elpa] externals/dash 2436bf8 361/439: Add debug declaration on -lambda, Phillip Lord, 2015/08/04
- [elpa] externals/dash 9e1a667 360/439: Do not map nodes on conses (be consistent with tree map), Phillip Lord, 2015/08/04
- [elpa] externals/dash 75d29a2 363/439: Declare --iterate macro before using it. #102, Phillip Lord, 2015/08/04
- [elpa] externals/dash 3bdf60b 365/439: Add some examples, Phillip Lord, 2015/08/04
- [elpa] externals/dash 03b98ca 364/439: Make -if-let and -when-let families destructure their arguments, Phillip Lord, 2015/08/04
- [elpa] externals/dash 549bfd3 366/439: Reorder macros to make sure they are declared before being used, Phillip Lord, 2015/08/04
- [elpa] externals/dash 8707aaf 367/439: Update docs,
Phillip Lord <=
- [elpa] externals/dash 63fa64f 368/439: Add links to references in readme, Phillip Lord, 2015/08/04
- [elpa] externals/dash 0c045f2 369/439: Highlight with el instead of cl, Phillip Lord, 2015/08/04
- [elpa] externals/dash d459b49 374/439: Fix typo, Phillip Lord, 2015/08/04
- [elpa] externals/dash c09c0f6 372/439: Merge branch 'more-destructuring' (#103) of https://github.com/fbergroth/dash.el, Phillip Lord, 2015/08/04
- [elpa] externals/dash 38ef86e 376/439: Update debug forms for -if-let and -when-let, Phillip Lord, 2015/08/04
- [elpa] externals/dash 446c522 375/439: Release 2.10.0, Phillip Lord, 2015/08/04
- [elpa] externals/dash 5e9c1a9 373/439: Add Fredrik Bergroth to the list of contributors, Phillip Lord, 2015/08/04
- [elpa] externals/dash c134705 377/439: Fix compile warning, Phillip Lord, 2015/08/04
- [elpa] externals/dash c7b4cff 370/439: Update readme.md, Phillip Lord, 2015/08/04
- [elpa] externals/dash 8d2227d 380/439: Silence unused variable warning in -table, Phillip Lord, 2015/08/04