[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash d7174ed 160/439: Handle cons-cells properly in -fl
From: |
Phillip Lord |
Subject: |
[elpa] externals/dash d7174ed 160/439: Handle cons-cells properly in -flatten |
Date: |
Tue, 04 Aug 2015 20:27:25 +0000 |
branch: externals/dash
commit d7174ed63a874112d96100d4d0a4ac41dfeff5c1
Author: Magnar Sveen <address@hidden>
Commit: Magnar Sveen <address@hidden>
Handle cons-cells properly in -flatten
Fixes #21
---
dash.el | 2 +-
dev/examples.el | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dash.el b/dash.el
index 7f4c281..6ca2fea 100644
--- a/dash.el
+++ b/dash.el
@@ -201,7 +201,7 @@ through the REP function."
(defun -flatten (l)
"Takes a nested list L and returns its contents as a single, flat list."
- (if (listp l)
+ (if (and (listp l) (listp (cdr l)))
(-mapcat '-flatten l)
(list l)))
diff --git a/dev/examples.el b/dev/examples.el
index 40a1ed3..caa7f5c 100644
--- a/dev/examples.el
+++ b/dev/examples.el
@@ -59,7 +59,8 @@
(defexamples -flatten
(-flatten '((1))) => '(1)
- (-flatten '((1 (2 3) (((4 (5))))))) => '(1 2 3 4 5))
+ (-flatten '((1 (2 3) (((4 (5))))))) => '(1 2 3 4 5)
+ (-flatten '(1 2 (3 . 4))) => '(1 2 (3 . 4)))
(defexamples -concat
(-concat '(1)) => '(1)
- [elpa] externals/dash c218e9f 150/439: -split-at/with now makes just one pass over list, (continued)
- [elpa] externals/dash c218e9f 150/439: -split-at/with now makes just one pass over list, Phillip Lord, 2015/08/04
- [elpa] externals/dash adfafcb 152/439: Add -partition-by-header, Phillip Lord, 2015/08/04
- [elpa] externals/dash a4b70f9 154/439: [magnars/dash.el#18] implementing -slice, Phillip Lord, 2015/08/04
- [elpa] externals/dash dac28b0 155/439: Merge pull request #19 from Wilfred/master, Phillip Lord, 2015/08/04
- [elpa] externals/dash bd942e1 158/439: inhibit dev from being added to the load-path, Phillip Lord, 2015/08/04
- [elpa] externals/dash 0351ca3 156/439: Add Wilfred Hughes to list of contributors., Phillip Lord, 2015/08/04
- [elpa] externals/dash 2451f99 159/439: Merge pull request #20 from tarsius/master, Phillip Lord, 2015/08/04
- [elpa] externals/dash 6ffdc93 157/439: Release 1.1.0, Phillip Lord, 2015/08/04
- [elpa] externals/dash a559a80 161/439: Added -last, Phillip Lord, 2015/08/04
- [elpa] externals/dash a40fc00 162/439: Merge pull request #23 from Fuco1/last, Phillip Lord, 2015/08/04
- [elpa] externals/dash d7174ed 160/439: Handle cons-cells properly in -flatten,
Phillip Lord <=
- [elpa] externals/dash a1b04d8 163/439: Less implementation specific docs for -mapcat, Phillip Lord, 2015/08/04
- [elpa] externals/dash 9371ce4 164/439: Don't use the word collection when meaning list, Phillip Lord, 2015/08/04
- [elpa] externals/dash c3dc883 166/439: Merge pull request #26 from shosti/when-if-let, Phillip Lord, 2015/08/04
- [elpa] externals/dash 6420bf8 167/439: Add Emanuel Evans to list of contributors, Phillip Lord, 2015/08/04
- [elpa] externals/dash 1396102 165/439: Add -when-let and -if-let macros, Phillip Lord, 2015/08/04
- [elpa] externals/dash 30ac13b 168/439: Add -insert-at (closes #27), Phillip Lord, 2015/08/04
- [elpa] externals/dash d5c124d 170/439: Update @shosti's list of contributions., Phillip Lord, 2015/08/04
- [elpa] externals/dash 1754ae2 171/439: Typo, Phillip Lord, 2015/08/04
- [elpa] externals/dash 79e3b92 172/439: Fix -when-let and -if-let docstrings, Phillip Lord, 2015/08/04
- [elpa] externals/dash 0ff070b 169/439: Merge pull request #28 from shosti/master, Phillip Lord, 2015/08/04