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: Michael Heerdegen
Subject: Re: [External] : Re: Testing whether a list contains at least one non-nil element
Date: Sat, 29 Oct 2022 08:10:21 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Stefan Monnier via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:

> PS: For the curious, here's what the above `named-let` expands to:
>
> (defalias 'has-non-nil
>   #'(lambda (lst)
>       (let ((lst lst))
>         (let (retval)
>           (while
>             (let ((lst lst))
>               (cond
>                ((null lst) nil)
>                ((consp lst) (let ((val (not (null (car lst)))))
>                               (if val (progn (setq retval val) nil)
>                                 (progn (setq lst (cdr lst)) :recurse))))
>                (t (progn (setq retval (error "Not a proper list! You 
> cheater!"))
>                          nil)))))
>           retval))))

Is that :recurse symbol only there to improve readability, or is it
handled specially?

Michael.




reply via email to

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