unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Paul Pogonyshev <pogonyshev@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: RE: Arbitrary function: find the number(s) of expected arguments
Date: Fri, 25 Mar 2016 11:19:04 -0700 (PDT)	[thread overview]
Message-ID: <27c271fe-da82-4856-8d32-610235e89e78@default> (raw)
In-Reply-To: <CAG7BpaqsbKP5+18z7Pcu2QACL-Hf5Lm1xum5dXxVaxW1FmjLDQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2475 bytes --]

(Please use plain-text for this mailing list from now on. I won't bother trying to convert the formatting this time.)

 

> IIUC, you _cannot_ use `func-arity' to test whether something

> is a subr.

Yes, but you can and should use `subrp' for that.

Of course you can. But that's irrelevant here. This is about what `subr-arity' does. Its behavior is not the same as `func-arity' for a non-subr. If we are not deprecating `subr-arity' then it is not enough to send users to the doc for `func-arity'.

> IOW, I am repeating the same argument I made before, when

> I said that `subr-arity' should not be deprecated and

> simply replaced by `func-arity'.

I understood it as argument against aliasing `subr-arity' to

the new function: this can break _existing_ code if it relies

on the fact that `subr-arity' signals an error when called with

anything, but builtin.

Yes. And?

The same argument applies to just having its doc string tell users to use `func-arity'. That might not break existing code, but it breaks the doc string. It no longer says what function `subr-arity' does. And it gives the false impression that `func-arity' does the same thing. In fact, `func-arity' does something different if the arg is not a subr.

> This is a step backward.  Unless we are really deprecating

> and replacing it, we should document `subr-arity' properly,

> as before, with the addition of cross-ref to see `func-arity',

> stating that it handles any type of function.

I personally don't see why we need two functions for this.

So, I would deprecate `subr-arity', but keep it around for

backward compatibility.

I personally feel the opposite - see my argument about not breaking existing code. But if that will be the decision then that's different. So far, there has been no decision to deprecate `subr-arity', AFAIK.

On the other hand, I don't really care. All I want is that there

is `func-arity' that works for _any_ function. I'm not attached

to anything in the patch and as long as `func-arity' works,

`func-arity' works for any function. So your want is satisfied.

However, obtaining your want at the expense of also breaking a doc string is not right.

feel free to change anything.

I'm not going to change the broken doc string. But I certainly hope that someone will.

When code is improved, if that change entails needing to change the doc, then the doc should be updated appropriately.

[-- Attachment #2: Type: text/html, Size: 7369 bytes --]

  reply	other threads:[~2016-03-25 18:19 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-15 18:48 Arbitrary function: find the number(s) of expected arguments Paul Pogonyshev
2016-03-15 22:45 ` Davis Herring
2016-03-16  7:41   ` Paul Pogonyshev
2016-03-19 12:26     ` Paul Pogonyshev
2016-03-19 13:10       ` Eli Zaretskii
2016-03-19 13:42         ` Paul Pogonyshev
2016-03-19 13:54         ` Michael Heerdegen
2016-03-19 14:08           ` Eli Zaretskii
2016-03-19 15:20             ` Michael Heerdegen
2016-03-19 15:43               ` Eli Zaretskii
2016-03-19 15:57                 ` Michael Heerdegen
2016-03-19 16:24                   ` Eli Zaretskii
2016-03-19 17:43                     ` Michael Heerdegen
2016-03-19 17:50                       ` Eli Zaretskii
2016-03-19 17:59                         ` Michael Heerdegen
2016-03-19 18:14                           ` Eli Zaretskii
2016-03-19 16:14                 ` Philipp Stephani
2016-03-19 16:27                   ` Michael Heerdegen
2016-03-19 16:27                   ` Eli Zaretskii
2016-03-19 16:30                     ` Philipp Stephani
2016-03-19 16:32                       ` Eli Zaretskii
2016-03-19 16:34                         ` Philipp Stephani
2016-03-19 16:46                           ` Philipp Stephani
2016-03-19 16:47                           ` Eli Zaretskii
2016-03-19 17:16                             ` Philipp Stephani
2016-03-19 17:48                               ` Eli Zaretskii
2016-03-19 17:49                                 ` Philipp Stephani
2016-03-19 18:11                                   ` Eli Zaretskii
2016-03-19 18:35                                     ` Michael Heerdegen
2016-04-18 23:02                 ` Davis Herring
2016-03-19 19:52         ` Stefan Monnier
2016-03-19 20:33           ` Eli Zaretskii
2016-03-19 22:43             ` Stefan Monnier
2016-03-26 15:55           ` Elias Mårtenson
2016-03-26 17:20             ` Stefan Monnier
2016-03-19 14:26       ` Philipp Stephani
2016-03-19 16:51         ` Paul Pogonyshev
2016-03-19 18:09           ` Eli Zaretskii
2016-03-19 19:32             ` Michael Heerdegen
2016-03-19 19:39               ` Eli Zaretskii
2016-03-19 20:59                 ` Michael Heerdegen
2016-03-21 18:36             ` Paul Pogonyshev
2016-03-25  8:44               ` Eli Zaretskii
2016-03-25 16:16                 ` Paul Pogonyshev
2016-03-25 16:35                   ` Drew Adams
2016-03-25 17:16                     ` Paul Pogonyshev
2016-03-25 18:19                       ` Drew Adams [this message]
2016-03-25 18:28                         ` Clément Pit--Claudel
2016-03-25 18:51                           ` Use plain-text for mail [was: Arbitrary function: find the number(s) of expected arguments] Drew Adams
2016-03-25 18:57                             ` Use plain-text for mail [ Lars Magne Ingebrigtsen
2016-03-25 19:49                               ` Andreas Schwab
2016-03-26  1:12                             ` Use plain-text for mail [was: Arbitrary function: find the number(s) of expected arguments] Yuri Khan
2016-03-25 17:39                     ` Arbitrary function: find the number(s) of expected arguments Eli Zaretskii
2016-03-25 18:31                       ` Drew Adams
2016-03-26  8:27                   ` Eli Zaretskii
2016-03-26 11:42                     ` Paul Pogonyshev
2016-04-02  9:48                       ` Eli Zaretskii
     [not found]           ` <<83y49e731p.fsf@gnu.org>
2016-03-19 19:21             ` Drew Adams
2016-04-18 18:43               ` Davis Herring
2016-03-16  3:47 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=27c271fe-da82-4856-8d32-610235e89e78@default \
    --to=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=pogonyshev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).