Skip to content

Commit

Permalink
Revert "Add macro seq-setq."
Browse files Browse the repository at this point in the history
This reverts commit a8a3fd8.

The same patch was applied twice.  Remove the second instance.
  • Loading branch information
larsmagne committed Aug 14, 2021
1 parent 22d8e71 commit 3fd0cc8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 41 deletions.
17 changes: 0 additions & 17 deletions doc/lispref/sequences.texi
Expand Up @@ -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.

Expand Down
24 changes: 0 additions & 24 deletions test/lisp/emacs-lisp/seq-tests.el
Expand Up @@ -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))
Expand Down

0 comments on commit 3fd0cc8

Please sign in to comment.