Prefer variadic cycle/new

TODO: Ensure all */new functions in my Elisp library share this API.
This commit is contained in:
William Carroll 2019-12-24 12:29:00 +00:00
parent 837a74f10f
commit d13e347b9f

View file

@ -26,10 +26,10 @@
;; `xs' is the original list ;; `xs' is the original list
(cl-defstruct cycle current-index xs) (cl-defstruct cycle current-index xs)
(defun cycle/new () (defun cycle/new (&rest xs)
"Create an empty cycle." "Create an empty cycle."
(make-cycle :current-index 0 (make-cycle :current-index 0
:xs '())) :xs xs))
(defun cycle/from-list (xs) (defun cycle/from-list (xs)
"Create a cycle from a list of `XS'." "Create a cycle from a list of `XS'."