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

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

Re: [External] : Re: Testing whether a list contains at least one non-ni


From: Emanuel Berg
Subject: Re: [External] : Re: Testing whether a list contains at least one non-nil element
Date: Sat, 29 Oct 2022 11:19:29 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

tomas wrote:

> If you are doing it "by hand", why not indulge in Lisp's
> "classic elegance", like so:
>
>   (defun has-non-nil (lst)
>     (cond
>      ((null lst) nil)
>      ((consp lst) (or (not (null (car lst))) (has-non-nil (cdr lst))))
>      (t (error "Not a proper list! You cheater!"))))

Did you mean: recursion

https://www.google.com/search?q=recursion

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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