[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] fix/group-by-write-out 63d2db9 05/14: make ->>'s second arg optio
From: |
Phillip Lord |
Subject: |
[elpa] fix/group-by-write-out 63d2db9 05/14: make ->>'s second arg optional |
Date: |
Tue, 04 Aug 2015 19:45:05 +0000 |
branch: fix/group-by-write-out
commit 63d2db9a117066bb351e4cfb98ae3e726407c308
Author: Cameron T Saul <address@hidden>
Commit: Cameron T Saul <address@hidden>
make ->>'s second arg optional
---
dash.el | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/dash.el b/dash.el
index 9788de6..483b080 100644
--- a/dash.el
+++ b/dash.el
@@ -1168,16 +1168,17 @@ second item in second form, etc."
(list form x)))
(:else `(-> (-> ,x ,form) ,@more))))
-(defmacro ->> (x form &rest more)
+(defmacro ->> (x &optional form &rest more)
"Thread the expr through the forms. Insert X as the last item
in the first form, making a list of it if it is not a list
already. If there are more forms, insert the first form as the
last item in second form, etc."
- (if (null more)
- (if (listp form)
- `(,(car form) ,@(cdr form) ,x)
- (list form x))
- `(->> (->> ,x ,form) ,@more)))
+ (cond
+ ((null form) x)
+ ((null more) (if (listp form)
+ `(,@form ,x)
+ (list form x)))
+ (:else `(->> (->> ,x ,form) ,@more))))
(defmacro --> (x form &rest more)
"Thread the expr through the forms. Insert X at the position
- [elpa] branch fix/group-by-write-out created (now 36310ed), Phillip Lord, 2015/08/04
- [elpa] fix/group-by-write-out 7aec562 04/14: Merge pull request #140 from mijoharas/master, Phillip Lord, 2015/08/04
- [elpa] fix/group-by-write-out 45bd985 01/14: Reimplementation of --group-by., Phillip Lord, 2015/08/04
- [elpa] fix/group-by-write-out aa13c07 03/14: fixed typo in docs (first where it should be last, Phillip Lord, 2015/08/04
- [elpa] fix/group-by-write-out 63d2db9 05/14: make ->>'s second arg optional,
Phillip Lord <=
- [elpa] fix/group-by-write-out 1677338 02/14: Merge pull request #138 from phillord/fix/group-by-write-out, Phillip Lord, 2015/08/04
- [elpa] fix/group-by-write-out 89abffe 11/14: Make it explicit that not all VALS are evalled in -if-let*, Phillip Lord, 2015/08/04
- [elpa] fix/group-by-write-out 70caa37 06/14: Merge pull request #144 from cammsaul/thread_last_make_second_arg_optional, Phillip Lord, 2015/08/04
- [elpa] fix/group-by-write-out eadb265 13/14: Swap examples to better show how -some-> works, Phillip Lord, 2015/08/04
- [elpa] fix/group-by-write-out 36310ed 14/14: Added .elpaignore., Phillip Lord, 2015/08/04
- [elpa] fix/group-by-write-out c3cf98d 12/14: Add `-some->`, `-some->>`, and `-some-->` macros., Phillip Lord, 2015/08/04
- [elpa] fix/group-by-write-out e468937 09/14: Formatting, Phillip Lord, 2015/08/04
- [elpa] fix/group-by-write-out b88cfb7 10/14: Add dash prefix to epsilon variable., Phillip Lord, 2015/08/04
- [elpa] fix/group-by-write-out 1c2f43d 08/14: Add "See also" for the reduce family, Phillip Lord, 2015/08/04
- [elpa] fix/group-by-write-out 2aeeacb 07/14: Release 2.11.0, Phillip Lord, 2015/08/04