unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Renaming some functions
@ 2020-05-03 21:21 Stefan Monnier
  2020-05-04  0:13 ` Dmitry Gutov
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Stefan Monnier @ 2020-05-03 21:21 UTC (permalink / raw)
  To: emacs-devel

Here's my first concrete renaming proposition:

    multibyte-string-p  =>  string-multibyte-p

Any objection?


        Stefan




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Renaming some functions
  2020-05-03 21:21 Renaming some functions Stefan Monnier
@ 2020-05-04  0:13 ` Dmitry Gutov
  2020-05-04  2:30 ` Eli Zaretskii
  2020-05-04  3:15 ` Richard Stallman
  2 siblings, 0 replies; 10+ messages in thread
From: Dmitry Gutov @ 2020-05-04  0:13 UTC (permalink / raw)
  To: Stefan Monnier, emacs-devel

On 04.05.2020 00:21, Stefan Monnier wrote:
> Here's my first concrete renaming proposition:
> 
>      multibyte-string-p  =>  string-multibyte-p

Yes, please.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Renaming some functions
  2020-05-03 21:21 Renaming some functions Stefan Monnier
  2020-05-04  0:13 ` Dmitry Gutov
@ 2020-05-04  2:30 ` Eli Zaretskii
  2020-05-04  2:59   ` Stefan Monnier
  2020-05-04  3:15 ` Richard Stallman
  2 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2020-05-04  2:30 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Sun, 03 May 2020 17:21:31 -0400
> 
> Here's my first concrete renaming proposition:
> 
>     multibyte-string-p  =>  string-multibyte-p
> 
> Any objection?

We are not renaming anything, we are discussing aliases that could
make discoverability easier.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Renaming some functions
  2020-05-04  2:30 ` Eli Zaretskii
@ 2020-05-04  2:59   ` Stefan Monnier
  2020-05-04 14:25     ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2020-05-04  2:59 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

>> Here's my first concrete renaming proposition:
>>
>>     multibyte-string-p  =>  string-multibyte-p
>>
>> Any objection?
>
> We are not renaming anything, we are discussing aliases that could
> make discoverability easier.

Yes, and a general discussion is pointless (because I'm not interested
in a general renaming.  Only in a few specific ones).  Hence this specific
proposition which should be considered in isolation.

The purpose is not to make discoverability easier.  It's to make the
namespace more regular (which then brings various potential benefits such
as easier discoverability, better code completion, ...).

This function is used 51 times in Emacs's own source code, and once in
GNU ELPA, so changing it has a fairly low impact.  The only reason
I care about it is because I happen to use it fairly often in `M-:` and
after getting confused between the two names enough times, I added an
alias for myself and now I think it's time we admit that the original
name was simply an error.


        Stefan




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Renaming some functions
  2020-05-03 21:21 Renaming some functions Stefan Monnier
  2020-05-04  0:13 ` Dmitry Gutov
  2020-05-04  2:30 ` Eli Zaretskii
@ 2020-05-04  3:15 ` Richard Stallman
  2020-05-04  5:11   ` Stefan Monnier
  2 siblings, 1 reply; 10+ messages in thread
From: Richard Stallman @ 2020-05-04  3:15 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > Here's my first concrete renaming proposition:

  >     multibyte-string-p  =>  string-multibyte-p

  > Any objection?

The actual behavior of the function is to return t if the argument is
a multibyte string, nil for any other type.  The clear name for that
is multibyte-string-p.

string-multibyte-p implies a function that accepts only strings as arguments
and returns t if the argument is multibyte.

ISTR that I thought about this when I defined that function, to choose
which of those two names to give it.

-- 
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Renaming some functions
  2020-05-04  3:15 ` Richard Stallman
@ 2020-05-04  5:11   ` Stefan Monnier
  0 siblings, 0 replies; 10+ messages in thread
From: Stefan Monnier @ 2020-05-04  5:11 UTC (permalink / raw)
  To: Richard Stallman; +Cc: emacs-devel

>   > Here's my first concrete renaming proposition:
>
>   >     multibyte-string-p  =>  string-multibyte-p
>
>   > Any objection?
>
> The actual behavior of the function is to return t if the argument is
> a multibyte string, nil for any other type.  The clear name for that
> is multibyte-string-p.
>
> string-multibyte-p implies a function that accepts only strings as arguments
> and returns t if the argument is multibyte.

AFAICT, it's only ever called with a string as argument (IOW its
behavior on non-strings is basically of no consequence), so both names
work as well from that point of view.


        Stefan




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Renaming some functions
  2020-05-04  2:59   ` Stefan Monnier
@ 2020-05-04 14:25     ` Eli Zaretskii
  2020-05-04 17:37       ` Stefan Monnier
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2020-05-04 14:25 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: emacs-devel@gnu.org
> Date: Sun, 03 May 2020 22:59:39 -0400
> 
> >>     multibyte-string-p  =>  string-multibyte-p
> >>
> >> Any objection?
> >
> > We are not renaming anything, we are discussing aliases that could
> > make discoverability easier.
> 
> Yes, and a general discussion is pointless (because I'm not interested
> in a general renaming.  Only in a few specific ones).  Hence this specific
> proposition which should be considered in isolation.

You want to actually rename this?  Then you know the drill: leave the
old name as an obsolete alias, wait for 10 years, then remove the
alias.

However, based on what Richard wrote, maybe we should have both of
these functions ;-)



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Renaming some functions
  2020-05-04 14:25     ` Eli Zaretskii
@ 2020-05-04 17:37       ` Stefan Monnier
  2020-05-05  2:53         ` Richard Stallman
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2020-05-04 17:37 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

>> >>     multibyte-string-p  =>  string-multibyte-p
>> >>
>> >> Any objection?
>> >
>> > We are not renaming anything, we are discussing aliases that could
>> > make discoverability easier.
>> 
>> Yes, and a general discussion is pointless (because I'm not interested
>> in a general renaming.  Only in a few specific ones).  Hence this specific
>> proposition which should be considered in isolation.
>
> You want to actually rename this?

Yes.

> Then you know the drill: leave the old name as an obsolete alias, wait
> for 10 years, then remove the alias.

Yup.

> However, based on what Richard wrote, maybe we should have both of
> these functions ;-)

That would be worse than the status quo.


        Stefan




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Renaming some functions
  2020-05-04 17:37       ` Stefan Monnier
@ 2020-05-05  2:53         ` Richard Stallman
  2020-05-05  7:18           ` Philippe Vaucher
  0 siblings, 1 reply; 10+ messages in thread
From: Richard Stallman @ 2020-05-05  2:53 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: eliz, emacs-devel

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  >> >>     multibyte-string-p  =>  string-multibyte-p

  > > However, based on what Richard wrote, maybe we should have both of
  > > these functions ;-)

I did not suggest that we should define both names.
What I said was that each name goes naturally with a different
meaning.  I think implementing either one of them is sufficient.

-- 
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Renaming some functions
  2020-05-05  2:53         ` Richard Stallman
@ 2020-05-05  7:18           ` Philippe Vaucher
  0 siblings, 0 replies; 10+ messages in thread
From: Philippe Vaucher @ 2020-05-05  7:18 UTC (permalink / raw)
  To: Richard Stallman; +Cc: Eli Zaretskii, Stefan Monnier, Emacs developers

>   >> >>     multibyte-string-p  =>  string-multibyte-p
>
>   > > However, based on what Richard wrote, maybe we should have both of
>   > > these functions ;-)
>
> I did not suggest that we should define both names.
> What I said was that each name goes naturally with a different
> meaning.  I think implementing either one of them is sufficient.

The current "multibyte-" prefix contains only a few functions. Maybe
it's too small to
warrant its own category?



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-05-05  7:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-03 21:21 Renaming some functions Stefan Monnier
2020-05-04  0:13 ` Dmitry Gutov
2020-05-04  2:30 ` Eli Zaretskii
2020-05-04  2:59   ` Stefan Monnier
2020-05-04 14:25     ` Eli Zaretskii
2020-05-04 17:37       ` Stefan Monnier
2020-05-05  2:53         ` Richard Stallman
2020-05-05  7:18           ` Philippe Vaucher
2020-05-04  3:15 ` Richard Stallman
2020-05-04  5:11   ` Stefan Monnier

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).