* Re: [Emacs-diffs] master 50548fd: cl-fill: Rename arguments to cl-seq and cl-item
[not found] ` <20160813042950.2B1CB2201C2@vcs.savannah.gnu.org>
@ 2016-08-13 6:06 ` Stefan Monnier
2016-08-16 14:00 ` Leo Liu
0 siblings, 1 reply; 13+ messages in thread
From: Stefan Monnier @ 2016-08-13 6:06 UTC (permalink / raw)
To: emacs-devel; +Cc: Tino Calancha
> 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
> Emacs-diffs@gnu.org
> https://lists.gnu.org/mailman/listinfo/emacs-diffs
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Emacs-diffs] master 50548fd: cl-fill: Rename arguments to cl-seq and cl-item
2016-08-13 6:06 ` [Emacs-diffs] master 50548fd: cl-fill: Rename arguments to cl-seq and cl-item Stefan Monnier
@ 2016-08-16 14:00 ` Leo Liu
2016-08-16 15:04 ` Stefan Monnier
2016-08-17 9:32 ` Tino Calancha
0 siblings, 2 replies; 13+ messages in thread
From: Leo Liu @ 2016-08-16 14:00 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Tino Calancha, emacs-devel
On 2016-08-13 02:06 -0400, Stefan Monnier wrote:
>> 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
Apparently the functions surrounding cl-fill use cl- prefix. so the
change appear to be more cosmetic than technical.
Leo
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Emacs-diffs] master 50548fd: cl-fill: Rename arguments to cl-seq and cl-item
2016-08-16 14:00 ` Leo Liu
@ 2016-08-16 15:04 ` Stefan Monnier
2016-08-16 15:24 ` John Wiegley
2016-08-24 15:13 ` Clément Pit--Claudel
2016-08-17 9:32 ` Tino Calancha
1 sibling, 2 replies; 13+ messages in thread
From: Stefan Monnier @ 2016-08-16 15:04 UTC (permalink / raw)
To: Leo Liu; +Cc: Tino Calancha, emacs-devel
> Apparently the functions surrounding cl-fill use cl- prefix. so the
> change appear to be more cosmetic than technical.
Indeed. But since the "cl-" prefix has to be used for global (aka
dynamically scoped) variables, it's good practice to *not* use it for
lexically scoped variables.
IOW, I'm all for such cosmetic changes that harmonize the code, but we
should do that by removing (rather than adding) the "cl-" prefix where
it's not needed.
Stefan
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Emacs-diffs] master 50548fd: cl-fill: Rename arguments to cl-seq and cl-item
2016-08-16 15:04 ` Stefan Monnier
@ 2016-08-16 15:24 ` John Wiegley
2016-08-16 15:40 ` Drew Adams
2016-08-24 15:13 ` Clément Pit--Claudel
1 sibling, 1 reply; 13+ messages in thread
From: John Wiegley @ 2016-08-16 15:24 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel, Leo Liu, Tino Calancha
>>>>> "SM" == Stefan Monnier <monnier@IRO.UMontreal.CA> writes:
SM> IOW, I'm all for such cosmetic changes that harmonize the code, but we
SM> should do that by removing (rather than adding) the "cl-" prefix where
SM> it's not needed.
Yay!
--
John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [Emacs-diffs] master 50548fd: cl-fill: Rename arguments to cl-seq and cl-item
2016-08-16 15:24 ` John Wiegley
@ 2016-08-16 15:40 ` Drew Adams
2016-08-16 17:09 ` Stefan Monnier
0 siblings, 1 reply; 13+ messages in thread
From: Drew Adams @ 2016-08-16 15:40 UTC (permalink / raw)
To: John Wiegley, Stefan Monnier; +Cc: Tino Calancha, Leo Liu, emacs-devel
>> IOW, I'm all for such cosmetic changes that harmonize the code, but we
>> should do that by removing (rather than adding) the "cl-" prefix where
>> it's not needed.
>
> Yay!
To clarify things more, we should prefix all `cl-'-prefixed names
with another `cl-': `cl-cl-cdr', etc. If we later find that names
are still confusing we can try `cl-cl-cl-cdr', etc. ;-)
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Emacs-diffs] master 50548fd: cl-fill: Rename arguments to cl-seq and cl-item
2016-08-16 15:40 ` Drew Adams
@ 2016-08-16 17:09 ` Stefan Monnier
2016-08-16 17:12 ` John Wiegley
2016-08-16 17:31 ` Robert Weiner
0 siblings, 2 replies; 13+ messages in thread
From: Stefan Monnier @ 2016-08-16 17:09 UTC (permalink / raw)
To: Drew Adams; +Cc: John Wiegley, Tino Calancha, Leo Liu, emacs-devel
> To clarify things more, we should prefix all `cl-'-prefixed names
> with another `cl-': `cl-cl-cdr', etc. If we later find that names
That would be safer, yes.
> are still confusing we can try `cl-cl-cl-cdr', etc. ;-)
I think 3 "cl-" should be enough for everyone,
Stefan
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Emacs-diffs] master 50548fd: cl-fill: Rename arguments to cl-seq and cl-item
2016-08-16 17:09 ` Stefan Monnier
@ 2016-08-16 17:12 ` John Wiegley
2016-08-16 17:31 ` Robert Weiner
1 sibling, 0 replies; 13+ messages in thread
From: John Wiegley @ 2016-08-16 17:12 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Tino Calancha, Leo Liu, Drew Adams, emacs-devel
>>>>> Stefan Monnier <monnier@IRO.UMontreal.CA> writes:
>> are still confusing we can try `cl-cl-cl-cdr', etc. ;-)
> I think 3 "cl-" should be enough for everyone,
Along with the 512K that I run my computer on? :) Never underestimate how
many cl-'s the future will need!!
--
John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Emacs-diffs] master 50548fd: cl-fill: Rename arguments to cl-seq and cl-item
2016-08-16 17:09 ` Stefan Monnier
2016-08-16 17:12 ` John Wiegley
@ 2016-08-16 17:31 ` Robert Weiner
2016-08-16 18:15 ` Lars Ingebrigtsen
1 sibling, 1 reply; 13+ messages in thread
From: Robert Weiner @ 2016-08-16 17:31 UTC (permalink / raw)
To: Stefan Monnier
Cc: John Wiegley, emacs-devel, Leo Liu, Drew Adams, Tino Calancha
[-- Attachment #1: Type: text/plain, Size: 232 bytes --]
On Tue, Aug 16, 2016 at 1:09 PM, Stefan Monnier <monnier@iro.umontreal.ca>
wrote:
> I think 3 "cl-" should be enough for everyone,
Would not an infinite recursion of cl-'s help show people the
possibilities?
Bob
[-- Attachment #2: Type: text/html, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Emacs-diffs] master 50548fd: cl-fill: Rename arguments to cl-seq and cl-item
2016-08-16 15:04 ` Stefan Monnier
2016-08-16 15:24 ` John Wiegley
@ 2016-08-24 15:13 ` Clément Pit--Claudel
1 sibling, 0 replies; 13+ messages in thread
From: Clément Pit--Claudel @ 2016-08-24 15:13 UTC (permalink / raw)
To: emacs-devel; +Cc: Tino Calancha
[-- Attachment #1.1: Type: text/plain, Size: 562 bytes --]
On 2016-08-16 11:04, Stefan Monnier wrote:
>> Apparently the functions surrounding cl-fill use cl- prefix. so the
>> change appear to be more cosmetic than technical.
>
> Indeed. But since the "cl-" prefix has to be used for global (aka
> dynamically scoped) variables, it's good practice to *not* use it for
> lexically scoped variables.
>
> IOW, I'm all for such cosmetic changes that harmonize the code, but we
> should do that by removing (rather than adding) the "cl-" prefix where
> it's not needed.
Should the change be reverted, then?
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Emacs-diffs] master 50548fd: cl-fill: Rename arguments to cl-seq and cl-item
2016-08-16 14:00 ` Leo Liu
2016-08-16 15:04 ` Stefan Monnier
@ 2016-08-17 9:32 ` Tino Calancha
1 sibling, 0 replies; 13+ messages in thread
From: Tino Calancha @ 2016-08-17 9:32 UTC (permalink / raw)
To: Leo Liu, Stefan Monnier; +Cc: emacs-devel
On 08/16/2016 11:00 PM, Leo Liu wrote:
> On 2016-08-13 02:06 -0400, Stefan Monnier wrote:
>>> 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
> Apparently the functions surrounding cl-fill use cl- prefix. so the
> change appear to be more cosmetic than technical.
>
> Leo
I confirm Leo explanation is 100% is right about my intentions.
I am sorry for the troubles.
Tino
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2016-08-24 15:13 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20160813042949.31299.44303@vcs.savannah.gnu.org>
[not found] ` <20160813042950.2B1CB2201C2@vcs.savannah.gnu.org>
2016-08-13 6:06 ` [Emacs-diffs] master 50548fd: cl-fill: Rename arguments to cl-seq and cl-item Stefan Monnier
2016-08-16 14:00 ` Leo Liu
2016-08-16 15:04 ` Stefan Monnier
2016-08-16 15:24 ` John Wiegley
2016-08-16 15:40 ` Drew Adams
2016-08-16 17:09 ` Stefan Monnier
2016-08-16 17:12 ` John Wiegley
2016-08-16 17:31 ` Robert Weiner
2016-08-16 18:15 ` Lars Ingebrigtsen
2016-08-17 9:35 ` Tino Calancha
2016-08-24 0:04 ` Stefan Monnier
2016-08-24 15:13 ` Clément Pit--Claudel
2016-08-17 9:32 ` Tino Calancha
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).