From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: pjb@informatimago.com (Pascal J. Bourguignon) Newsgroups: gmane.emacs.help Subject: Re: How do lisp gurus truncate? Date: Thu, 23 Jul 2009 19:31:29 +0200 Organization: Informatimago Message-ID: <87zlavjoge.fsf@galatea.local> References: <87hbx31gah.fsf@kobe.laptop> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1248370908 22595 80.91.229.12 (23 Jul 2009 17:41:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Jul 2009 17:41:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 23 19:41:42 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 1MU2IX-0006QC-JG for geh-help-gnu-emacs@m.gmane.org; Thu, 23 Jul 2009 19:41:41 +0200 Original-Received: from localhost ([127.0.0.1]:47408 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MU2IX-0001yK-2u for geh-help-gnu-emacs@m.gmane.org; Thu, 23 Jul 2009 13:41:41 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 17 Original-X-Trace: individual.net akxIvvobJQUQw1bYMnsN1wsaJkR2nRzIMvIoz2gDJyiyxXBs3V Cancel-Lock: sha1:YTExYmQ5ZDcwYTc0MTIyOGJiNzk0ZDk5NDVkMmNjNjJlYTAzMGM3ZQ== sha1:3V6fj4bj9AtB56n4mdc8mDy9LFU= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (darwin) Original-Xref: news.stanford.edu gnu.emacs.help:171175 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:66365 Archived-At: Giorgos Keramidas writes: > My only concern about find/nthcdr is that if the list can get very very > long, you are essentially going to iterate over it twice. But I am not > sure if there's a function like `find' that will return the cons cell > instead of the value at position N. Too bad you discarded member earlier... In Common Lisp it takes a :test argument like find and other functions. In emacs, a variant named member* provides the same feature: (require 'cl) (member* 3 '(1.5 2.5 3.5 4.5 5.5) :test (function <)) --> (3.5 4.5 5.5) -- __Pascal Bourguignon__