help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Testing whether a list contains at least one non-nil element


From: Jean Louis
Subject: Re: Testing whether a list contains at least one non-nil element
Date: Tue, 25 Oct 2022 13:46:28 +0300
User-agent: Mutt/2.2.7+37 (a90f69b) (2022-09-02)

* Heime <heimeborgia@protonmail.com> [2022-10-25 13:18]:
> 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.

(cond ((memq nil '(1 2 nil)) (message "True, there is nil inside"))
      ((memq nil '(1 2 3)) (message "No, there is no nil inside"))) ⇒ "True, 
there is nil inside"


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]