[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 3fd0cc8: Revert "Add macro `seq-setq`."
From: |
Lars Ingebrigtsen |
Subject: |
master 3fd0cc8: Revert "Add macro `seq-setq`." |
Date: |
Sat, 14 Aug 2021 09:30:43 -0400 (EDT) |
branch: master
commit 3fd0cc85a58775e0a09efb88649bea9dd28c5491
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Revert "Add macro `seq-setq`."
This reverts commit a8a3fd8f8e27089ac46bf98e534529ff03f679a5.
The same patch was applied twice. Remove the second instance.
---
doc/lispref/sequences.texi | 17 -----------------
test/lisp/emacs-lisp/seq-tests.el | 24 ------------------------
2 files changed, 41 deletions(-)
diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi
index 257f5d1..20816ce 100644
--- a/doc/lispref/sequences.texi
+++ b/doc/lispref/sequences.texi
@@ -1128,23 +1128,6 @@ assigned to variables as if by @code{setq} instead of as
in a
@end example
@end defmac
-@defmac seq-setq var-sequence val-sequence
-@cindex sequence destructuring
- This macro works similarly to @code{seq-let}, except that values are
-assigned to variables as if by @code{setq} instead of as in a
-@code{let} binding.
-
-@example
-@group
-(let ((a nil)
- (b nil))
- (seq-setq (_ a _ b) '(1 2 3 4))
- (list a b))
-@result{} (2 4)
-@end group
-@end example
-@end defmac
-
@defun seq-random-elt sequence
This function returns an element of @var{sequence} taken at random.
diff --git a/test/lisp/emacs-lisp/seq-tests.el
b/test/lisp/emacs-lisp/seq-tests.el
index 5217921..44e855e 100644
--- a/test/lisp/emacs-lisp/seq-tests.el
+++ b/test/lisp/emacs-lisp/seq-tests.el
@@ -407,30 +407,6 @@ Evaluate BODY for each created sequence.
(should (null b))
(should (null c))))
-(ert-deftest test-seq-setq ()
- (with-test-sequences (seq '(1 2 3 4))
- (let (a b c d e)
- (seq-setq (a b c d e) seq)
- (should (= a 1))
- (should (= b 2))
- (should (= c 3))
- (should (= d 4))
- (should (null e)))
- (let (a b others)
- (seq-setq (a b &rest others) seq)
- (should (= a 1))
- (should (= b 2))
- (should (same-contents-p others (seq-drop seq 2)))))
- (let ((a)
- (seq '(1 (2 (3 (4))))))
- (seq-setq (_ (_ (_ (a)))) seq)
- (should (= a 4)))
- (let (seq a b c)
- (seq-setq (a b c) seq)
- (should (null a))
- (should (null b))
- (should (null c))))
-
(ert-deftest test-seq-min-max ()
(with-test-sequences (seq '(4 5 3 2 0 4))
(should (= (seq-min seq) 0))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 3fd0cc8: Revert "Add macro `seq-setq`.",
Lars Ingebrigtsen <=