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

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

Re: cl-dolist, dolist, cl-return,


From: Emanuel Berg
Subject: Re: cl-dolist, dolist, cl-return,
Date: Wed, 08 Jul 2015 12:17:27 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

"Pascal J. Bourguignon" <pjb@informatimago.com>
writes:

> (loop for item in list until (some-condition-p
> item))

These loops are brilliant! Only there are so many,
which overlap... Perhaps one could draw a
"periodic table" of Lisp loops. I remember something
like that from the book "Land of Lisp", but I read
that at the library so I can't check.
Good book, anyway.

    @book{land-of-lisp,
      title      = {Land of Lisp},
      author     = {Conrad Barski},
      publisher  = {No Starch},
      year       = 2010,
      ISBN       = 1593272812
    }

In C there are what I remember only three loops (if
you don't count recursion, or gotos for that matter) -
the familiar for, while, and 'do while'. It is
possible to construct all (?) loops with these, but
I like the Lisp way more where it can be expressed in
syntax, not merely constructed in code.

The loop finally turned up like this:

    (cl-loop for b in (erc-buffer-list)
             when (neq b (current-buffer)) do ...

-- 
underground experts united
http://user.it.uu.se/~embe8573




reply via email to

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