* lisp/emacs-lisp/seq.el (seq-mapn): Do not copy list arguments.
* test/lisp/emacs-lisp/seq-tests.el (test-seq-mapn-circular-lists):
Add a regression test.
\(fn FUNCTION SEQUENCES...)"
(let ((result nil)
- (sequences (seq-map (lambda (s) (seq-into s 'list))
+ (sequences (seq-map (lambda (s)
+ (if (listp s)
+ s
+ (seq-into s 'list)))
(cons sequence sequences))))
(while (not (memq nil sequences))
(push (apply function (seq-map #'car sequences)) result)
(should-error (seq-random-elt []))
(should-error (seq-random-elt "")))
+(ert-deftest test-seq-mapn-circular-lists ()
+ (let ((l1 '#1=(1 . #1#)))
+ (should (equal (seq-mapn #'+ '(3 4 5 7) l1)
+ '(4 5 6 8)))))
+
(provide 'seq-tests)
;;; seq-tests.el ends here