From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#54639: 26.1; (not (string-empty-p nil)) returns true Date: Thu, 31 Mar 2022 13:26:56 +0200 Message-ID: <874k3e8irj.fsf@gnus.org> References: <874k3fza1w.fsf@debianx1e> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25930"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 54639@debbugs.gnu.org To: Ernesto Alfonso Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 31 13:29:22 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nZszR-0006WF-5Q for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 31 Mar 2022 13:29:21 +0200 Original-Received: from localhost ([::1]:51240 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nZszP-0005Kl-TJ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 31 Mar 2022 07:29:19 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZsyD-0003mA-V6 for bug-gnu-emacs@gnu.org; Thu, 31 Mar 2022 07:28:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44159) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nZsy9-0001RK-R4 for bug-gnu-emacs@gnu.org; Thu, 31 Mar 2022 07:28:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nZsy9-0002gd-J0 for bug-gnu-emacs@gnu.org; Thu, 31 Mar 2022 07:28:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 31 Mar 2022 11:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54639 X-GNU-PR-Package: emacs Original-Received: via spool by 54639-submit@debbugs.gnu.org id=B54639.164872603010248 (code B ref 54639); Thu, 31 Mar 2022 11:28:01 +0000 Original-Received: (at 54639) by debbugs.gnu.org; 31 Mar 2022 11:27:10 +0000 Original-Received: from localhost ([127.0.0.1]:38053 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZsxJ-0002fE-M8 for submit@debbugs.gnu.org; Thu, 31 Mar 2022 07:27:09 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:53056) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZsxH-0002ew-Hd for 54639@debbugs.gnu.org; Thu, 31 Mar 2022 07:27:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=8gPalNJLgJm5gUBkPWxAbKj8hT6Dd96T2yXvo3LHyuc=; b=u9QLfL3qwIQbq4o149XNtQcELV YvhIA6QrkIXXXqMhcg7T+W8hJvUmVy5cUZI7UZs1t2dl+cbfI6drcXIjjWrNikmlrYEO6QwJTC5Na vFLZZzyQyd3JZNHuihIg1yZXNX/ZSG6wJ2r/5VTe+/5dSRKtyfsmNbaayv2rWhsE5/aA=; Original-Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nZsx8-0002x7-QH; Thu, 31 Mar 2022 13:27:00 +0200 In-Reply-To: <874k3fza1w.fsf@debianx1e> (Ernesto Alfonso's message of "Wed, 30 Mar 2022 12:20:43 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:229147 Archived-At: Ernesto Alfonso writes: > The expression (not (string-empty-p nil)) returns true. This is very > conuterintuitive: nil is as "empty" a value as there is! But nil isn't a string, and the function is only (meant to be) valid for strings. It "works" for symbols by accident. > Some of the more reasonable alternatives I can think of in order of > preference are: > > 1. (string-empty-p nil) simply returns t > 2. (string-empty-p nil) raises a type error We can't change how an established function works -- that would break people's code. > 3. subr-x.el provides a separate string-null-or-empty-p function That would be just (zerop (length OBJECT)), which doesn't quite seem worth having a function when the function name is longer than the expression it replaces. (And it would be misleading to have the function name start with string- since it works on other things, too.) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no