branch: externals/dash
commit 51a0c9f64fd33b733421a6c11afe3fbd2dc677d4
Author: Matus Goljer <[email protected]>
Commit: Matus Goljer <[email protected]>
[-let] Fix expansion of _ symbols in vector matcher
---
dash.el | 3 ++-
dev/examples.el | 2 ++
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/dash.el b/dash.el
index 0b3474f..c456b88 100644
--- a/dash.el
+++ b/dash.el
@@ -1306,7 +1306,8 @@ is discarded."
;; do not match symbols starting with _
(not (eq (aref (symbol-name m) 0) ?_)))
(list (list m `(aref ,source ,i))))
- (t (dash--match m `(aref ,source ,i))))
+ ((not (symbolp m))
+ (dash--match m `(aref ,source ,i))))
re)
(setq i (1+ i))))
(-flatten-n 1 (nreverse re))))
diff --git a/dev/examples.el b/dev/examples.el
index d29c707..ba09d1f 100644
--- a/dev/examples.el
+++ b/dev/examples.el
@@ -720,6 +720,8 @@ new list."
(list bar face inv)) => '(2 foo-face t)
(-let [(a (b c) d) (list 1 (list 2 3) 4 5 6)] (list a b c d)) => '(1 2 3 4)
(-let [[a _ c] [1 2 3 4]] (list a c)) => '(1 3)
+ (-let [[_ _ _ a] (vector 1 2 3 4)] a) => 4
+ (-let [[a _ _ _ b] (vector 1 2 3 4 5)] (list a b)) => '(1 5)
(-let [[a (b c) d] [1 (2 3) 4]] (list a b c d)) => '(1 2 3 4)
(-let [[a b c] (string ?f ?o ?b ?a ?r)] (list a b c)) => '(?f ?o ?b)
(-let [[a b c] "abcdef"] (list a b c)) => '(?a ?b ?c)