From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rupert Swarbrick Newsgroups: gmane.emacs.help Subject: What to use instead of find-if? Date: Mon, 01 Dec 2008 19:56:13 +0000 Organization: albasani.net Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1228164140 8361 80.91.229.12 (1 Dec 2008 20:42:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Dec 2008 20:42:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 01 21:43:25 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L7Fc2-0007DN-Qy for geh-help-gnu-emacs@m.gmane.org; Mon, 01 Dec 2008 21:43:23 +0100 Original-Received: from localhost ([127.0.0.1]:55114 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L7Fas-0003Ul-KT for geh-help-gnu-emacs@m.gmane.org; Mon, 01 Dec 2008 15:42:10 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.albasani.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 40 Original-X-Trace: news.albasani.net fwHM8gQlAM0jzRkga33gJfjRDyQCyJ0vmpoWTvkIw4e/ZiS+/4K/jZfBmxCAXL2lmnG8nhRIJFelEzslHuYhsE8ibj07aQr83Yiu78aWFq79MxFBVav+NjO52mrqAfMI Original-X-Complaints-To: abuse@albasani.net Original-NNTP-Posting-Date: Mon, 1 Dec 2008 19:56:48 +0000 (UTC) X-User-ID: BWowun4p/ECJeOKXHKpKf+dWjmd+05gljUQLgggm+io= Cancel-Lock: sha1:zJHgRoeU+MPjjsRzYBhTsK5kHqk= User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux) X-NNTP-Posting-Host: 6SvMYVRi16tsj7kpwoaDdPuFDiwVsTNa9EhUxqDB9WM= Original-Xref: news.stanford.edu gnu.emacs.help:164969 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:60293 Archived-At: --=-=-= 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 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iJwEAQECAAYFAkk0QV0ACgkQRtd/pJbYVoZYHAP/TTNF/ojDr6wj63RI+XkDwuaU W6Qxllt/7fp73v0WqfxtssEkcEYFD+0CjulKlccfTA633Ua/z8MUaPtHaRMGKuiV V1yNtjoSeL8t5wXuk1VSnftfhtP4Qls+NqSlZNQCOEl7Pe4Ttr0sFK1ruxJYO6L5 3r+0bk7Gx0+8g3E2lkQ= =oiWe -----END PGP SIGNATURE----- --=-=-=--