[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash c8c6ea4 05/14: [Fix #154] Clarify that -flatten de
From: |
Phillip Lord |
Subject: |
[elpa] externals/dash c8c6ea4 05/14: [Fix #154] Clarify that -flatten destroys all nils. |
Date: |
Sun, 04 Oct 2015 12:01:00 +0000 |
branch: externals/dash
commit c8c6ea4aa1b12abd15e8f943125edf4cec08b663
Author: Matus Goljer <address@hidden>
Commit: Matus Goljer <address@hidden>
[Fix #154] Clarify that -flatten destroys all nils.
---
dash.el | 8 ++++++++
dev/examples.el | 5 ++++-
2 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/dash.el b/dash.el
index ac143bc..9a82064 100644
--- a/dash.el
+++ b/dash.el
@@ -396,6 +396,14 @@ Thus function FN should return a list."
(defun -flatten (l)
"Take a nested list L and return its contents as a single, flat list.
+Note that because `nil' represents a list of zero elements (an
+empty list), any mention of nil in L will disappear after
+flattening. If you need to preserve nils, consider `-flatten-n'
+or map them to some unique symbol and then map them back.
+
+Conses of two atoms are considered \"terminals\", that is, they
+aren't flattened further.
+
See also: `-flatten-n'"
(if (and (listp l) (listp (cdr l)))
(-mapcat '-flatten l)
diff --git a/dev/examples.el b/dev/examples.el
index 2410eda..8491ccb 100644
--- a/dev/examples.el
+++ b/dev/examples.el
@@ -179,7 +179,10 @@ new list."
(defexamples -flatten
(-flatten '((1))) => '(1)
(-flatten '((1 (2 3) (((4 (5))))))) => '(1 2 3 4 5)
- (-flatten '(1 2 (3 . 4))) => '(1 2 (3 . 4)))
+ (-flatten '(1 2 (3 . 4))) => '(1 2 (3 . 4))
+ (-flatten '(nil nil nil)) => nil
+ (-flatten '(nil (1) nil)) => '(1)
+ (-flatten '(nil (nil) nil)) => nil)
(defexamples -flatten-n
(-flatten-n 1 '((1 2) ((3 4) ((5 6))))) => '(1 2 (3 4) ((5 6)))
- [elpa] externals/dash updated (eadb265 -> fa90644), Phillip Lord, 2015/10/08
- [elpa] externals/dash ce3c2fe 01/14: Errant paren removed from -let documentation., Phillip Lord, 2015/10/08
- [elpa] externals/dash ffe72fb 08/14: Update documentation., Phillip Lord, 2015/10/08
- [elpa] externals/dash c8c6ea4 05/14: [Fix #154] Clarify that -flatten destroys all nils.,
Phillip Lord <=
- [elpa] externals/dash dbe2bf2 10/14: Merge pull request #160 from phillord/feature/gnu-elpa-support, Phillip Lord, 2015/10/08
- [elpa] externals/dash 3e2e0b5 03/14: Merge pull request #131 from phillord/fix/documentation-for-let, Phillip Lord, 2015/10/08
- [elpa] externals/dash fa90644 14/14: Release 2.12.0, Phillip Lord, 2015/10/08
- [elpa] externals/dash 8fa70c5 12/14: [Fix #101] Use faster hashtable implementation for -union., Phillip Lord, 2015/10/08
- [elpa] externals/dash 66cb6f5 09/14: Merge pull request #146 from holomorph/info-macros, Phillip Lord, 2015/10/08
- [elpa] externals/dash 5d2a73c 07/14: [Fix #155] -is-suffix? no longer destroys input list., Phillip Lord, 2015/10/08
- [elpa] externals/dash 91a2b14 13/14: [Fix #101] Fix reversed condition for hashtable -union., Phillip Lord, 2015/10/08
- [elpa] externals/dash 3ae7335 02/14: Indicate macros in generated info manual, Phillip Lord, 2015/10/08
- [elpa] externals/dash c6c2105 04/14: Add support for GNU ELPA., Phillip Lord, 2015/10/08
- [elpa] externals/dash 7e1c13e 06/14: Add Cam SaĆ¼l to the readme template as contributor., Phillip Lord, 2015/10/08