emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master 50548fd: cl-fill: Rename arguments to cl-seq an


From: Stefan Monnier
Subject: Re: [Emacs-diffs] master 50548fd: cl-fill: Rename arguments to cl-seq and cl-item
Date: Sat, 13 Aug 2016 02:06:24 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

>     cl-fill: Rename arguments to cl-seq and cl-item

Why?

The "cl-" prefix is for global vars.  It used to be used "everywhere"
for local vars as well because dynamic binding made the local vars
visible in other scopes as well, but nowadays that CL uses
lexical-binding this should not be needed any more and the tendency is
rather to eliminate use of the "cl-" prefix for args and local vars.

        Stefan


>     * lisp/emacs-lisp/cl-seq.el (cl-fill):
>     Rename arguments to 'cl-seq' and 'cl-item' as elsewhere.
> ---
>  lisp/emacs-lisp/cl-seq.el |   18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)

> diff --git a/lisp/emacs-lisp/cl-seq.el b/lisp/emacs-lisp/cl-seq.el
> index 98e5f4e..ed27b7c 100644
> --- a/lisp/emacs-lisp/cl-seq.el
> +++ b/lisp/emacs-lisp/cl-seq.el
> @@ -144,24 +144,24 @@ called.
>        cl-accum)))
 
>  ;;;###autoload
> -(defun cl-fill (seq item &rest cl-keys)
> +(defun cl-fill (cl-seq cl-item &rest cl-keys)
>    "Fill the elements of SEQ with ITEM.
>  \nKeywords supported:  :start :end
>  \n(fn SEQ ITEM [KEYWORD VALUE]...)"
>    (cl--parsing-keywords ((:start 0) :end) ()
> -    (if (listp seq)
> -     (let ((p (nthcdr cl-start seq))
> +    (if (listp cl-seq)
> +     (let ((p (nthcdr cl-start cl-seq))
>             (n (if cl-end (- cl-end cl-start) 8000000)))
>         (while (and p (>= (setq n (1- n)) 0))
> -         (setcar p item)
> +         (setcar p cl-item)
>           (setq p (cdr p))))
> -      (or cl-end (setq cl-end (length seq)))
> -      (if (and (= cl-start 0) (= cl-end (length seq)))
> -       (fillarray seq item)
> +      (or cl-end (setq cl-end (length cl-seq)))
> +      (if (and (= cl-start 0) (= cl-end (length cl-seq)))
> +       (fillarray cl-seq cl-item)
>       (while (< cl-start cl-end)
> -       (aset seq cl-start item)
> +       (aset cl-seq cl-start cl-item)
>         (setq cl-start (1+ cl-start)))))
> -    seq))
> +    cl-seq))
 
>  ;;;###autoload
>  (defun cl-replace (cl-seq1 cl-seq2 &rest cl-keys)

> _______________________________________________
> Emacs-diffs mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/emacs-diffs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]