From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.help Subject: Re: until-found Date: Fri, 11 Dec 2009 17:10:38 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1260549729 1991 80.91.229.12 (11 Dec 2009 16:42:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Dec 2009 16:42:09 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 11 17:42:03 2009 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 1NJ8Z8-0002lh-GP for geh-help-gnu-emacs@m.gmane.org; Fri, 11 Dec 2009 17:42:02 +0100 Original-Received: from localhost ([127.0.0.1]:32806 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NJ8Z8-0007tC-33 for geh-help-gnu-emacs@m.gmane.org; Fri, 11 Dec 2009 11:42:02 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!news.glorb.com!news2.glorb.com!news.glorb.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.kpnqwest.it!news.kpnqwest.it.POSTED!not-for-mail Original-NNTP-Posting-Date: Fri, 11 Dec 2009 10:10:39 -0600 Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:nY54lQMMs2VEYRNucjAbQRn+jUQ= Original-Lines: 29 X-Usenet-Provider: http://www.giganews.com Original-NNTP-Posting-Host: 212.46.191.75 Original-X-Trace: sv3-eXXH7KTs60F+Xb5G45+EO+21cJoJklToil5qcZmH3TYKNHTspSGvFRaOAbKjmSckTITCeju2Eer7+q7!MvFmL/kirzluzOqsUyv0Rs5mg9A8rmMuuWQ8lBEnqsMl551JV0yA9NI0ohDUTA== X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 Original-Xref: news.stanford.edu gnu.emacs.help:175519 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:70595 Archived-At: * Andreas Roehler [2009-12-10 13:50+0100] writes: > And here my implementation so far: > > (defun until-found (search-string liste) > (let ((liste liste) element) > (while liste > (if (member search-string (car liste)) > (setq element (car liste) liste nil)) > (setq liste (cdr liste))) > element)) This seems to be the same as: (car (member (lambda (element) (member search-string element)) liste)) or (find-if (lambda (element) (member search-string element)) liste) or (find search-string liste :test #'member) or (loop for e in liste if (member search-string e) return e) Helmut