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 17:43:36 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000b7351705951d1670" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="225188"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Eli Zaretskii , Lars Ingebrigtsen , Emacs developers To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 17 18:34:18 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 1iL8jC-000wSA-HO for ged-emacs-devel@m.gmane.org; Thu, 17 Oct 2019 18:34:18 +0200 Original-Received: from localhost ([::1]:52749 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL8jA-0007Su-NS for ged-emacs-devel@m.gmane.org; Thu, 17 Oct 2019 12:34:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60055) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL7wl-0004ov-1n for emacs-devel@gnu.org; Thu, 17 Oct 2019 11:44:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iL7wj-0006C1-Q6 for emacs-devel@gnu.org; Thu, 17 Oct 2019 11:44:14 -0400 Original-Received: from mail-qk1-x729.google.com ([2607:f8b0:4864:20::729]:44546) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iL7wi-0006BM-0j; Thu, 17 Oct 2019 11:44:12 -0400 Original-Received: by mail-qk1-x729.google.com with SMTP id u22so2264925qkk.11; Thu, 17 Oct 2019 08:44:11 -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=U/NOYcCy4KbnHrStRZfg0SucIoa+xWs9SHSnhghS7Ys=; b=HkCyhF6QHh3DkpspyXUuwmMCx7v0lfitPVrH3sChg0C9/iv3tMGQF/1PKne2mUNfW9 02NIEtfgkPTmQFjWGr33Zdp7QBAum6Rgn/8KYW3Zpiq9eOvUuWRqyr0uc2G0TZJy6hmp 4wBmEI3gA2zKr4mEzx3D0U4cw1SFav5Wi/4tiD3IH/l/LMoq5kvNCG1KYzZCbcNDZc7/ UTC8Tr0qnvwmpKvhXih3rcywpkj3bdGuw/4Gk7I9E7zCzPSDOSos+mtaHfE8ZOasc3QB A0tT2Cnofk5tnBZoQkIXkjZxZl0/Jknf9p9ms8xMOqF9F1lNXHyvhWcmpPHkLMnYo7zZ rbjQ== 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=U/NOYcCy4KbnHrStRZfg0SucIoa+xWs9SHSnhghS7Ys=; b=Nc7eASq/ESGy3LqUfpdThflL3J32R2nhOKgj90Nyw5XNyh1TfERGZbKPElEFeyA0vd DOYJcDOJRkSyfsmXFvOMbqoiX7XOKES8xwyHHE5SHRED3GSz96PR6+ffMqFAoNiPq1hd fhEo3rM7LwIhHwvs0xhsBnNbjhrn+43nl3Z8SahUyfkzOFsEmIx7skAsyximGlUyCx/k eHC7rKYpImMyYxvy2kGQqC4clVQysvuxy/i11XaCu2uqoZDRE0Z+MOG3HQJb7GLAeKtC MZGACZuMAJrevWpaxLMwfR6elUknfUMQlA5v62SgKADDJdQpFtHW6WArEviyIVN2qIE0 v0YQ== X-Gm-Message-State: APjAAAVNqXWHIK4S66wR+x+A5HM5lg/05mxUg9Dh56I/SsX//BU7SoC9 BC3za1alDo6JnkjEWGZrdujBVN0aKPcabDiDKY4= X-Google-Smtp-Source: APXvYqwo022Igos3lt9x6S2cV/vrJuNuCklCtU3CHuWmYcp+J9MgF4gyGyJ0pbT3Fk/odmP/9d3rVgWp1hrk5MjLyO8= X-Received: by 2002:ae9:c307:: with SMTP id n7mr3909638qkg.185.1571327051247; Thu, 17 Oct 2019 08:44:11 -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::729 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:241148 Archived-At: --000000000000b7351705951d1670 Content-Type: text/plain; charset="UTF-8" The issue here is not transforming every "predicate" -p function into one returning t/nil. That's not what my patches did. And in my original answer I already said that most predicates return t/nil, but not *all*. I would contend that "predicates" not returning t/nil aren't really predicates, but that's a discussion for another day. Most of my latest patches make the function follow its documented interface (the docstring), which shouldn't be so controversial. In fact, if some function relied on the documented t result, if was risking getting something different, often in obscure cases. So I'd say this patch will help uncover bugs. (I'd be surprised that a function, for example, documented as "return t", returning a marker in *some* cases, is being used purposely so by the client code.) In other cases, they fix problems; either because the docstring says that it returns t, but in fact they return a useful non-nil value, or because the functions say non-nil/nil, but are in fact functions that, but it's very nature, will always return only t/nil. That shouldn't be controversial, either. I mean, if some specific change in my patches is a mistake, let's discuss it or fix it. But mostly, what I've done is fixing latent bugs, either in the documentation or the code. --000000000000b7351705951d1670 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The issue here is not transforming every "predicate&q= uot; -p function into one returning t/nil. That's not what my patches d= id. And in my original answer I already said that most predicates return t/= nil, but not *all*. I would contend that "predicates" not returni= ng t/nil aren't really predicates, but that's a discussion for anot= her day.

Most of my latest patches make the function follow its doc= umented interface (the docstring), which shouldn't be so controversial.= In fact, if some function relied on the documented t result, if was riskin= g getting something different, often in obscure cases. So I'd say this = patch will help uncover bugs. (I'd be surprised that a function, for ex= ample, documented as "return t", returning a marker in *some* cas= es, is being used purposely so by the client code.)

In other cases, = they fix problems; either because=C2=A0the docstring says that it returns t= , but in fact they return a useful non-nil value, or because the functions = say non-nil/nil, but are in fact functions that, but it's very nature, = will always return only t/nil. That shouldn't be controversial, either.=

I mean, if some specific change in my patches is a mistake, let'= ;s discuss it or fix it. But mostly, what I've done is fixing latent bu= gs, either in the documentation or the code.
--000000000000b7351705951d1670--