branch: externals/dash
commit 65a373665b17952f7242cf03b9da6e6452ae2efd
Author: Matus Goljer <[email protected]>
Commit: Matus Goljer <[email protected]>
[-let] Fix improper list non-symbol last argument handler
---
dash.el | 2 +-
dev/examples.el | 2 ++
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/dash.el b/dash.el
index f83ffaa..0b3474f 100644
--- a/dash.el
+++ b/dash.el
@@ -1251,7 +1251,7 @@ SOURCE is a proper or improper list."
nil)
;; Handle improper lists. Last matching place, no need for shift
(t
- (list (list match-form (dash--match-cons-get-cdr skip-cdr source)))))))
+ (dash--match match-form (dash--match-cons-get-cdr skip-cdr source))))))
(defun dash--vector-tail (seq start)
"Return the tail of SEQ starting at START."
diff --git a/dev/examples.el b/dev/examples.el
index 99cc5dc..d29c707 100644
--- a/dev/examples.el
+++ b/dev/examples.el
@@ -741,6 +741,8 @@ new list."
(error "previous call should fail.")))
(args-out-of-range t)) => t
(-let [(a . (b . c)) (cons 1 (cons 2 3))] (list a b c)) => '(1 2 3)
+ (-let [(_ _ . [a b]) (cons 1 (cons 2 (vector 3 4)))] (list a b)) => '(3 4)
+ (-let [(_ _ . (a b)) (cons 1 (cons 2 (list 3 4)))] (list a b)) => '(3 4)
;; final cdr optimization
(-let [(((a))) (list (list (list 1 2) 3) 4)] a) => 1
(-let [(((a b) c) d) (list (list (list 1 2) 3) 4)] (list a b c d)) => '(1
2 3 4)