From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: master 2bb0703 1/2: lisp/*.el: Force non-nil result to t, to match docstring Date: Thu, 17 Oct 2019 20:18:15 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000e1ed2905951f3f44" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="147006"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Eli Zaretskii , Lars Ingebrigtsen , Drew Adams , Emacs developers To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 17 20:19:19 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iLAMp-000c98-7C for ged-emacs-devel@m.gmane.org; Thu, 17 Oct 2019 20:19:19 +0200 Original-Received: from localhost ([::1]:55968 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLAMn-0004y1-LI for ged-emacs-devel@m.gmane.org; Thu, 17 Oct 2019 14:19:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58625) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLAMU-0004pd-Hz for emacs-devel@gnu.org; Thu, 17 Oct 2019 14:18:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLAMT-0005sT-DD for emacs-devel@gnu.org; Thu, 17 Oct 2019 14:18:58 -0400 Original-Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]:38067) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iLAMR-0005qI-3u; Thu, 17 Oct 2019 14:18:55 -0400 Original-Received: by mail-qk1-x72a.google.com with SMTP id p4so2790039qkf.5; Thu, 17 Oct 2019 11:18:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CX8TvPTPcVMci3R06aTSHUZ4QOuwiSVD1IcZgxNAkn8=; b=ZQgQ8jTycFrASIyKwAd/GdwP9WQ4JeLecTL9inLYXm6zXo9kFnbSNa1UMqcRZ0QTmF Y2JMKwkQfm13OoPuqKaoCY2eifTPJ2Nb6N5edP2PtP3QiCkTHguNg55D5RYQPEP6nk2j Xs9PzyDW1UB1LWsaK5BJpb9SD61dWzZPAqxvIOJKMdonNgKOjn7yGdbzlumURCzufg4/ v78Vg6faqvqWZzxIrejZZIF65czuY31jrp6wGga7D7kcKlN2aiqlm3fztVm1ui2olTYX 5xy4m2BJmC38JqZbHDJsjLRQ3q3YAa01WcF0pLOeHUrV5Nv/gPm17cvlFXb4Ksj5jWvt N4eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CX8TvPTPcVMci3R06aTSHUZ4QOuwiSVD1IcZgxNAkn8=; b=Vh9UIawBKBUuROHPvfa4embepewMh/7tU8ZZl6tQ1E8nIAwE/7p9QJ8z4mPB6IH+GB y4LoF6MKf8vaz38cmoiUsxGCiXUM6sjnLhkt3y8JYdkDqDSVC+Zni4BJ6vA7QsPlaVCb nYG6bs3K4ARA+eWyNxCYpAJjYV3s86B+jM2DxM29E5jlQDkZx+lQtnUTBmomoQZTZsxz epdlg4OEQ1R0ooxqozV8pXAKh+DXCEA+yHwOESo/3x8mtzDOrowR+WcmSvcxf7WOxubn EFkc+EdSaXjDEjLfdi+bM9f9bio1LSEftVJN+CiVcLnXU+sqjZFFZ93Ruj7JnpdoB/SU fPxg== X-Gm-Message-State: APjAAAXbJlNNgrx/zccMnzIJ2DIMGurqMzLEgwPHb5fKfnsyA2PaqZRU 3qJcXyE93qd6ZJKYVl4g7OI44XnorPb3xlKKCXM= X-Google-Smtp-Source: APXvYqxMO8QmMGAyJKs0vEXnxete2LXG8h+s2/2c2PgTXaUVANpT6TLYEja+NRKRFrqZgWDpLwcxP9KGoWvhckF6f3A= X-Received: by 2002:a05:620a:896:: with SMTP id b22mr4660249qka.216.1571336331847; Thu, 17 Oct 2019 11:18:51 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::72a X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:241163 Archived-At: --000000000000e1ed2905951f3f44 Content-Type: text/plain; charset="UTF-8" On Thu, Oct 17, 2019 at 8:02 PM Stefan Monnier wrote: > > Just to be clear: this is a typical bikeshed subject. Definitely. > So far, AFAIK most of the code and docstrings use nil/non-nil, AFAICT > (which is why we're all familiar with the notion of "non-nil" as > a matter of fact) and as a maintainer I've made an effort to try and > standardize on this, e.g. by fixing docstrings which overspecified the > return value to `t`. There's a cascading effect. Some functions with multiple non-nil return values rely on other functions's declared boolean result to construct their own. So I think functions that can only return a boolean are not "overspecified" by saying so. YMMV. > The most important thing is to try and choose one and stick to it, both > for the benefit of consistency and to avoid back-and-forth > cosmetic changes. FWIW, I don't consider making a function return what its docstring says "a cosmetic change". --000000000000e1ed2905951f3f44 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Oct 17, 2019 at 8:02 PM Stefan Monnier <monnier@iro.umontreal.ca> wrote= :
>
> Just to be clear: this is a typical bikeshed subject.
=
Definitely.

> So far, AFAIK most of th= e code and docstrings use nil/non-nil, AFAICT
> (which is why we'= re all familiar with the notion of "non-nil" as
> a matter = of fact) and as a maintainer I've made an effort to try and
> sta= ndardize on this, e.g. by fixing docstrings which overspecified the
>= return value to `t`.=C2=A0=C2=A0

There's a cascading effect. So= me functions with multiple non-nil return values rely on other functions= 9;s declared boolean result to construct their own. So I think functions th= at can only=C2=A0return a boolean are not "overspecified" by sayi= ng so. YMMV.

> The most important thing is to try and = choose one and stick to it, both
> for the benefit of consistency and= to avoid back-and-forth
> cosmetic changes.

FWIW, = I don't consider making a function return what its docstring says "= ;a cosmetic change".=C2=A0
--000000000000e1ed2905951f3f44--