branch: externals/dash
commit 19fbc24559415a71fafc96812322e7178d437157
Author: Matus Goljer <[email protected]>
Commit: Matus Goljer <[email protected]>
Fix anaphoric -spice-list macro
---
dash.el | 2 +-
dev/examples.el | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dash.el b/dash.el
index 2c96cf9..fa4057c 100644
--- a/dash.el
+++ b/dash.el
@@ -439,7 +439,7 @@ See also: `-splice-list', `-insert-at'"
See also: `-splice', `-insert-at'"
(-splice pred (lambda (_) new-list) list))
-(defun --splice-list (pred new-list list)
+(defmacro --splice-list (pred new-list list)
"Anaphoric form of `-splice-list'."
`(-splice-list (lambda (it) ,pred) ,new-list ,list))
diff --git a/dev/examples.el b/dev/examples.el
index 21e8ba5..cd00df5 100644
--- a/dev/examples.el
+++ b/dev/examples.el
@@ -70,7 +70,8 @@ new list."
(defexamples -splice-list
(-splice-list 'keywordp '(a b c) '(1 :foo 2)) => '(1 a b c 2)
- (-splice-list 'keywordp nil '(1 :foo 2)) => '(1 2))
+ (-splice-list 'keywordp nil '(1 :foo 2)) => '(1 2)
+ (--splice-list (keywordp it) '(a b c) '(1 :foo 2)) => '(1 a b c 2))
(defexamples -mapcat
(-mapcat 'list '(1 2 3)) => '(1 2 3)