[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash bf85b21 242/426: Change &optional branches to &res
From: |
Phillip Lord |
Subject: |
[elpa] externals/dash bf85b21 242/426: Change &optional branches to &rest branches in `-if-let`s |
Date: |
Tue, 04 Aug 2015 19:38:01 +0000 |
branch: externals/dash
commit bf85b21eb21de486a31aca47be21e01aba906642
Author: Matus Goljer <address@hidden>
Commit: Matus Goljer <address@hidden>
Change &optional branches to &rest branches in `-if-let`s
---
dash.el | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/dash.el b/dash.el
index bb9defa..2e695d5 100644
--- a/dash.el
+++ b/dash.el
@@ -821,31 +821,31 @@ body."
(when it
,@body)))
-(defmacro -if-let (var-val then &optional else)
+(defmacro -if-let (var-val then &rest else)
"If VAL evaluates to non-nil, bind it to VAR and do THEN,
otherwise do ELSE. VAR-VAL should be a (VAR VAL) pair."
(let ((var (car var-val))
(val (cadr var-val)))
`(let ((,var ,val))
- (if ,var ,then ,else))))
+ (if ,var ,then ,@else))))
-(defmacro -if-let* (vars-vals then &optional else)
+(defmacro -if-let* (vars-vals then &rest else)
"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*')."
(let ((first-pair (car vars-vals))
(rest (cdr vars-vals)))
(if (= (length vars-vals) 1)
- `(-if-let ,first-pair ,then ,else)
+ `(-if-let ,first-pair ,then ,@else)
`(-if-let ,first-pair
- (-if-let* ,rest ,then ,else)
- ,else))))
+ (-if-let* ,rest ,then ,@else)
+ ,@else))))
-(defmacro --if-let (val then &optional else)
+(defmacro --if-let (val then &rest else)
"If VAL evaluates to non-nil, bind it to `it' and do THEN,
otherwise do ELSE."
`(let ((it ,val))
- (if it ,then ,else)))
+ (if it ,then ,@else)))
(put '-when-let 'lisp-indent-function 1)
(put '-when-let* 'lisp-indent-function 1)
- [elpa] externals/dash 8e2422a 239/426: Add Christina Whyte (@kurisuwhyte) to list of contributors, (continued)
- [elpa] externals/dash 8e2422a 239/426: Add Christina Whyte (@kurisuwhyte) to list of contributors, Phillip Lord, 2015/08/04
- [elpa] externals/dash 1e2bd96 233/426: Merge pull request #48 from Fuco1/index-operations, Phillip Lord, 2015/08/04
- [elpa] externals/dash d1913c6 210/426: Merge pull request #41 from Wilfred/master, Phillip Lord, 2015/08/04
- [elpa] externals/dash b4d84de 243/426: Add debug declarations for `-when-let`s and `-if-let`s, Phillip Lord, 2015/08/04
- [elpa] externals/dash 6d43c4f 235/426: Fix switched around doc strings for -find-index/indices, Phillip Lord, 2015/08/04
- [elpa] externals/dash 459322d 244/426: Update docs, Phillip Lord, 2015/08/04
- [elpa] externals/dash 9936885 245/426: Merge pull request #51 from Fuco1/debug-decl, Phillip Lord, 2015/08/04
- [elpa] externals/dash 0f4cae9 249/426: Improve docs, Phillip Lord, 2015/08/04
- [elpa] externals/dash 23ab726 227/426: Improve formatting of docs, Phillip Lord, 2015/08/04
- [elpa] externals/dash f4ba8db 252/426: Add -snoc, Phillip Lord, 2015/08/04
- [elpa] externals/dash bf85b21 242/426: Change &optional branches to &rest branches in `-if-let`s,
Phillip Lord <=
- [elpa] externals/dash bf99147 247/426: Fix `-tree-mapreduce-from` test & reformat the tests, Phillip Lord, 2015/08/04
- [elpa] externals/dash 75efb60 246/426: Add tree map/reduce, Phillip Lord, 2015/08/04
- [elpa] externals/dash 2ee84cb 251/426: Release 2.3.0, Phillip Lord, 2015/08/04
- [elpa] externals/dash ab727ba 257/426: Correct anchors for links starting with '!', Phillip Lord, 2015/08/04
- [elpa] externals/dash 8052eb9 253/426: Merge pull request #55 from Fuco1/snoc, Phillip Lord, 2015/08/04
- [elpa] externals/dash d8ccf85 254/426: Add replace/update/remove functions for index/indices, Phillip Lord, 2015/08/04
- [elpa] externals/dash ba6e3c6 260/426: Add missing keywords, Phillip Lord, 2015/08/04
- [elpa] externals/dash 87bcbc8 261/426: Merge pull request #59 from Fuco1/add-keywords, Phillip Lord, 2015/08/04
- [elpa] externals/dash 094fdea 262/426: Merge pull request #58 from Fuco1/fontlock-custom, Phillip Lord, 2015/08/04
- [elpa] externals/dash ca9b296 263/426: Add Cask-file., Phillip Lord, 2015/08/04