[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash db7f651 353/426: [-let] Simplify the conditions in
From: |
Phillip Lord |
Subject: |
[elpa] externals/dash db7f651 353/426: [-let] Simplify the conditions in dash--match-cons-1 |
Date: |
Tue, 04 Aug 2015 19:38:50 +0000 |
branch: externals/dash
commit db7f65142aafe783daf47c88afbb6cb57cf251c8
Author: Matus Goljer <address@hidden>
Commit: Matus Goljer <address@hidden>
[-let] Simplify the conditions in dash--match-cons-1
---
dash.el | 38 +++++++++++++-------------------------
1 files changed, 13 insertions(+), 25 deletions(-)
diff --git a/dash.el b/dash.el
index 2809d3b..5abfe54 100644
--- a/dash.el
+++ b/dash.el
@@ -1241,37 +1241,25 @@ there.
SOURCE is a proper or improper list."
(let ((skip-cdr (or (plist-get props :skip-cdr) 0)))
(cond
- ((and (consp match-form)
- (not (null match-form)))
+ ((consp match-form)
(cond
- ((symbolp (car match-form))
+ ((cdr match-form)
(cond
- ((eq (car match-form) '&keys)
- (when (cdr match-form)
- (dash--match-kv (cons '&plist (cdr match-form))
(dash--match-cons-get-cdr skip-cdr source))))
- ((cdr match-form)
- (cond
- ((eq (aref (symbol-name (car match-form)) 0) ?_)
- (dash--match-cons-1 (cdr match-form) source
- (plist-put props :skip-cdr (1+ skip-cdr))))
- (t
- (cons (list (car match-form) (dash--match-cons-skip-cdr skip-cdr
source))
- (dash--match-cons-1 (cdr match-form) source)))))
- ;; Last matching place, no need for shift
+ ((and (symbolp (car match-form))
+ (eq (car match-form) '&keys))
+ (dash--match-kv (cons '&plist (cdr match-form))
(dash--match-cons-get-cdr skip-cdr source)))
+ ((and (symbolp (car match-form))
+ (eq (aref (symbol-name (car match-form)) 0) ?_))
+ (dash--match-cons-1 (cdr match-form) source
+ (plist-put props :skip-cdr (1+ skip-cdr))))
(t
- (dash--match (car match-form) (dash--match-cons-get-car skip-cdr
source)))))
- (t
- (cond
- ((cdr match-form)
(-concat (dash--match (car match-form) (dash--match-cons-skip-cdr
skip-cdr source))
- (dash--match-cons-1 (cdr match-form) source)))
- ;; Last matching place, no need for shift
- (t
- (dash--match (car match-form) (dash--match-cons-get-car skip-cdr
source)))))))
+ (dash--match-cons-1 (cdr match-form) source)))))
+ (t ;; Last matching place, no need for shift
+ (dash--match (car match-form) (dash--match-cons-get-car skip-cdr
source)))))
((eq match-form nil)
nil)
- ;; Handle improper lists. Last matching place, no need for shift
- (t
+ (t ;; Handle improper lists. Last matching place, no need for shift
(dash--match match-form (dash--match-cons-get-cdr skip-cdr source))))))
(defun dash--vector-tail (seq start)
- [elpa] externals/dash 2436bf8 361/426: Add debug declaration on -lambda, (continued)
- [elpa] externals/dash 2436bf8 361/426: Add debug declaration on -lambda, Phillip Lord, 2015/08/04
- [elpa] externals/dash 4d67b25 345/426: [-let] Do not reinvent `pop', Phillip Lord, 2015/08/04
- [elpa] externals/dash f7664c6 352/426: [-let] Add &keys support for cons matcher, Phillip Lord, 2015/08/04
- [elpa] externals/dash 4b63be1 362/426: Declare --mapcat macro before using it. #102, Phillip Lord, 2015/08/04
- [elpa] externals/dash 0310e0e 359/426: Update docs, Phillip Lord, 2015/08/04
- [elpa] externals/dash 0fc5d73 351/426: [-let] Make the cons matcher temp-bind as late as possible, Phillip Lord, 2015/08/04
- [elpa] externals/dash 75d29a2 363/426: Declare --iterate macro before using it. #102, Phillip Lord, 2015/08/04
- [elpa] externals/dash 3bdf60b 365/426: Add some examples, Phillip Lord, 2015/08/04
- [elpa] externals/dash 65a3736 349/426: [-let] Fix improper list non-symbol last argument handler, Phillip Lord, 2015/08/04
- [elpa] externals/dash 549bfd3 366/426: Reorder macros to make sure they are declared before being used, Phillip Lord, 2015/08/04
- [elpa] externals/dash db7f651 353/426: [-let] Simplify the conditions in dash--match-cons-1,
Phillip Lord <=
- [elpa] externals/dash c6b92ae 324/426: Reorder the examples into more meaningful blocks, Phillip Lord, 2015/08/04
- [elpa] externals/dash 03b98ca 364/426: Make -if-let and -when-let families destructure their arguments, Phillip Lord, 2015/08/04
- [elpa] externals/dash 5e9c1a9 373/426: Add Fredrik Bergroth to the list of contributors, Phillip Lord, 2015/08/04
- [elpa] externals/dash 8707aaf 367/426: Update docs, Phillip Lord, 2015/08/04
- [elpa] externals/dash 63fa64f 368/426: Add links to references in readme, Phillip Lord, 2015/08/04
- [elpa] externals/dash d459b49 374/426: Fix typo, Phillip Lord, 2015/08/04
- [elpa] externals/dash 9e1a667 360/426: Do not map nodes on conses (be consistent with tree map), Phillip Lord, 2015/08/04
- [elpa] externals/dash 7185db8 311/426: [Issue #83] Add `step` to `-slice`, Phillip Lord, 2015/08/04
- [elpa] externals/dash 2b69c14 411/426: Add dash.info and dash.texi to repo, Phillip Lord, 2015/08/04
- [elpa] externals/dash c61fc34 417/426: Add -remove-first/last, -map-first/last, -replace-first/last, Phillip Lord, 2015/08/04