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.devel Subject: Always-true predicate? Date: Wed, 17 Feb 2021 13:01:45 +0100 Message-ID: <875z2qoqc6.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25849"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 17 13:03:09 2021 Return-path: Envelope-to: ged-emacs-devel@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 1lCLXx-0006Z6-7w for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Feb 2021 13:03:09 +0100 Original-Received: from localhost ([::1]:53848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lCLXv-0004gk-Bi for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Feb 2021 07:03:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCLWk-0003q2-Nu for emacs-devel@gnu.org; Wed, 17 Feb 2021 07:01:54 -0500 Original-Received: from quimby.gnus.org ([2a01:4f9:2b:f0f::2]:53244) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCLWj-0003l3-6w for emacs-devel@gnu.org; Wed, 17 Feb 2021 07:01:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :Date:Subject:To:From:Sender:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=qnFrQWyJRApm0AuX8afobWX79CpIGxRfV+LuzXTX4Q4=; b=l8p3Ux+HiZmSrtdyEnfB2x+jpV xU1DEE5xqc9n3yxk1mNvzSCYSQjHQ+eKSLGWHGf5aA7CK1EbJlUSb/CjxYyoEWA+e0iUXe0MdZzxD MzcVWxy7F4c5TOW/T6GCJz9b6LRD9dNSc75qP1T8F4WngGlQIk9dM9Z+sN5hxkCDLWRY=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lCLWc-0008EA-Ra for emacs-devel@gnu.org; Wed, 17 Feb 2021 13:01:49 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEUcGxogHhsmIh0v KiFEOib///9JOwZRAAAAAWJLR0QF+G/pxwAAAAd0SU1FB+UCEQs5DBNfbXsAAAGmSURBVDjLxVPb keQgDJTwBCDBBgBiAzCIBPaY/GM6AWOP9zFXdV/LB2Wr6ZbUAoDfW/i/AL8AkF5K8b+BOHdHl5Tz a8OJeAdJngxvBLcIyWF6MgKgUxXxf7a9tlKIv/ZBACLKrDTibAzGJMwu7wBhJ61wADm0yhS0pqhb b6WKEA5BLMV2cWC/uQCKi2RVvdFWJILzNZNqAqzq3QJUtUl6ryr9XuVduzYVy2Td+RgfDTB7RLaV jIEoYZT0xaubSVktVorES3xVRQQOEOlwg03N+tAWXa0Wni2bxYiDEdCcyn24tc/j9JAyt4JZ8Tmz LavqXremXSRxXBnmGqZDllysgxTX6dkIbN6Eyjk5XOfZw9ve6tanUjrDUwqrr6GwFxs48gnBtoN1 rQ8dSqfU7eMem95NS3y0AiwoExi9JM724w0YsbXBZkMll3W24EowME7gJtpdb90S5ZC1V52fad6g sMcjp+oYgMi8XVhpWU4gGYke88DxTJimn07K4BHz8Qx42k0oK4YngHj1Ci/ANX7MfF3o59XmOZKf XuZB+/b8+AUArxiL8xeaUTbcszVHHwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMS0wMi0xN1QxMTo1 NzoxMiswMDowMJ14qYoAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjEtMDItMTdUMTE6NTc6MTIrMDA6 MDDsJRE2AAAAAElFTkSuQmCC X-Now-Playing: Telefon Tel Aviv's _Dreams Are Not Enough_: "a younger version of myself," Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@gnus.org; helo=quimby.gnus.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:264994 Archived-At: Currently, Emacs has: ---- Sometimes, when you call a functional, it is useful to supply a no-op function as the argument. Here are two different kinds of no-op function: -- Function: identity argument This function returns ARGUMENT and has no side effects. -- Function: ignore &rest arguments This function ignores any ARGUMENTS and returns =E2=80=98nil=E2=80=99. ---- `identity' is kinda-sorta used as the opposite of `ignore' many places where you're feeding predicates to functions, but takes only one parameter and, of course, returns nil if you give it nil. Would it make sense to add a function that's exactly the opposite of `ignore' (for symmetry and convenience)? If so, what would it be called? I've googled to see what other languages do. Rust and NPM has "always", and many more Java-inspired frameworks have "truePredicate", but this isn't trivial to google for... --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no