From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Giorgos Keramidas Newsgroups: gmane.emacs.help Subject: Re: How do lisp gurus truncate? Date: Thu, 23 Jul 2009 23:35:00 +0300 Organization: SunSITE.dk - Supporting Open source Message-ID: <87eis7yw7f.fsf@kobe.laptop> References: <87hbx31gah.fsf@kobe.laptop> <87zlavjoge.fsf@galatea.local> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1248388894 19288 80.91.229.12 (23 Jul 2009 22:41:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Jul 2009 22:41:34 +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 Jul 24 00:41:27 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 1MU6ya-0001kj-0q for geh-help-gnu-emacs@m.gmane.org; Fri, 24 Jul 2009 00:41:24 +0200 Original-Received: from localhost ([127.0.0.1]:52107 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MU6yZ-0000qf-Ay for geh-help-gnu-emacs@m.gmane.org; Thu, 23 Jul 2009 18:41:23 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newsfeed.esat.net!colt.net!feeder.news-service.com!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!xindi.nntp.kabelfoon.nl!news.banetele.no!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (berkeley-unix) Cancel-Lock: sha1:nT6JqvD5wPw1SURUlt2jhc/s4sc= Original-Lines: 16 Original-NNTP-Posting-Host: 77.49.248.11 Original-X-Trace: news.sunsite.dk DXC=Ed0I<=_hLL^MjGbH?lJH1TkjLLPVaWK24>LNQ]Y 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:66368 Archived-At: On Thu, 23 Jul 2009 19:31:29 +0200, pjb@informatimago.com (Pascal J. Bourguignon) wrote: >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) Thank you! I should have look a bit better at the member docs :)