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

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

What to use instead of find-if?


From: Rupert Swarbrick
Subject: What to use instead of find-if?
Date: Mon, 01 Dec 2008 19:56:13 +0000
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux)

I was messing around last night and added a small feature to my local
copy of gnus. Cool. I reckon it'd be useful in general, so I was going
to post it to ding. Cool.

However

Looking back at the code, I realised I used cl's find-if (I know
somewhat more common lisp than elisp). And gnus doesn't (require
'cl). So the code I'm thinking about does the following:

  (let ((blah
         (find-if (lambda (elem)
                    (whopping-great-predicatey-thing))
                  some-list)))
    (if blah
        (something using blah)
      (something else)))

Can anyone suggest a vaguely idiomatic way to do this using the built-in
constructs of elisp? This is a genuine question, by the way. I'm sure
I'm being thick not spotting a neat way to write this.

Rupert

Attachment: pgpuiCR4Zo2en.pgp
Description: PGP signature


reply via email to

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