branch: externals/dash
commit 4b63be1dce156545bd5f534e91d4a491aa7b06e9
Author: Magnar Sveen <[email protected]>
Commit: Magnar Sveen <[email protected]>
Declare --mapcat macro before using it. #102
---
dash.el | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/dash.el b/dash.el
index 078305d..98c0df6 100644
--- a/dash.el
+++ b/dash.el
@@ -287,6 +287,16 @@ Elements are compared using `equal'.
See also: `-replace-at'"
(--map-when (equal it old) new list))
+(defmacro --mapcat (form list)
+ "Anaphoric form of `-mapcat'."
+ (declare (debug (form form)))
+ `(apply 'append (--map ,form ,list)))
+
+(defun -mapcat (fn list)
+ "Return the concatenation of the result of mapping FN over LIST.
+Thus function FN should return a list."
+ (--mapcat (funcall fn it) list))
+
(defun -flatten (l)
"Take a nested list L and return its contents as a single, flat list.
@@ -305,16 +315,6 @@ See also: `-flatten'"
"Return a new list with the concatenation of the elements in the supplied
LISTS."
(apply 'append lists))
-(defmacro --mapcat (form list)
- "Anaphoric form of `-mapcat'."
- (declare (debug (form form)))
- `(apply 'append (--map ,form ,list)))
-
-(defun -mapcat (fn list)
- "Return the concatenation of the result of mapping FN over LIST.
-Thus function FN should return a list."
- (--mapcat (funcall fn it) list))
-
(defalias '-copy 'copy-sequence
"Create a shallow copy of LIST.")