From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.help Subject: Re: Testing whether a list contains at least one non-nil element Date: Tue, 25 Oct 2022 19:25:21 +0200 Message-ID: <87r0yvst2a.fsf@fastmail.fm> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29454"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.8.3; emacs 28.1.91 Cc: help-gnu-emacs@gnu.org To: Heime Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 25 19:38:05 2022 Return-path: Envelope-to: geh-help-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 1onNsJ-0007Gn-P0 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 25 Oct 2022 19:38:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1onNs7-00075r-UZ; Tue, 25 Oct 2022 13:37:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1onNs6-0006rI-6t for help-gnu-emacs@gnu.org; Tue, 25 Oct 2022 13:37:50 -0400 Original-Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1onNrz-0002Jy-UO for help-gnu-emacs@gnu.org; Tue, 25 Oct 2022 13:37:49 -0400 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id E972B320092F; Tue, 25 Oct 2022 13:37:39 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 25 Oct 2022 13:37:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1666719459; x=1666805859; bh=bUlUsWAVso bvpjVoEyJnhATUWrCSFE2Hh8xYaI/ls3o=; b=ot7Ycva2f/1eFLIHTRz298aJzc ylqUmrnFu+XbWIExbw4xAkxk88M7ptlnEOt7VsO+zZfjiXP4Eist8yEQFxRuEmHj r88oDZ/KKfRk7wLPSA3b1KqDc/6bUEG12EEOFqgu67U2Cz9nMgBPUtLYIw+iUnRD 4XJaLUwc9s7kVfLoFpRNxA7yRjjAf0lRg/bilVjcMss0D70mJb6X2Ky8o0Z6eFWP Gl7WqJXJ/qiy1JvI+1y9ktddTer2xirbf0SFMtx7kz1FRv5/xXvsm6g/4FjIdBQj EMD19iFPMn/yQhR7WpSCSZchmbf8YOXKkUjVhJRo9bFR5oPrwrDGMNb8RLYw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1666719459; x=1666805859; bh=bUlUsWAVsobvpjVoEyJnhATUWrCS FE2Hh8xYaI/ls3o=; b=YRlEdHs/1wEkIF2nH4p91fimxfgn9VgT26PGxDsxJjfY kZQ28YqvTR32RlD2fu0DbVzmY7/FWclWrWrOmCmzp86fZfpz2JAv208AsFeiZ1Xp eJm469uenUPA3Wc67oHyeHrkgo2ESDCUjJvaZQgq+//ImH/tkg87IYvlUlk3pWlS qpec6FzHH6s8DZGBk9aKfokfYkSibtu57sR6rEaUJMmFmcLEQFciF7l3EtfbCvha DbMCLIJS3IdioD54QyrRq0mOL9tGmtPpKeznGXnkFOdAq+D3ELsgCaF0APswyRks J4kLcrgObA/AEEVVNSRd2tAD7ZS3629WlsBgYaq6ng== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrtddtgdekiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfhgfhffvvefuffgjkfggtgesthdtre dttdertdenucfhrhhomheplfhoohhsthcumfhrvghmvghrshcuoehjohhoshhtkhhrvghm vghrshesfhgrshhtmhgrihhlrdhfmheqnecuggftrfgrthhtvghrnhepgfeihfdutdetle ejheevkeejtdffueehfffhffefteeiteefhedtkedtiedtkeffnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhoohhsthhkrhgvmhgvrhhsse hfrghsthhmrghilhdrfhhm X-ME-Proxy: Feedback-ID: ie15541ac:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 25 Oct 2022 13:37:38 -0400 (EDT) In-reply-to: Received-SPF: pass client-ip=64.147.123.25; envelope-from=joostkremers@fastmail.fm; helo=wout2-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "help-gnu-emacs" Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:140378 Archived-At: On Tue, Oct 25 2022, Heime wrote: > I would like to test whether a list contains at least one non-nil element? If I do that, then > I would be able to continue a loop where a non-nil element would mean that a match was found. (seq-some (lambda (e) (not (null e))) mylist) or shorter: (not (seq-every-p #'null mylist)) If you use dash.el, there's also --any? (or --any-p if you prefer): (--any? (not (null it)) mylist) HTH -- Joost Kremers Life has its moments