[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How do lisp gurus truncate?
From: |
Giorgos Keramidas |
Subject: |
Re: How do lisp gurus truncate? |
Date: |
Thu, 23 Jul 2009 23:35:00 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (berkeley-unix) |
On Thu, 23 Jul 2009 19:31:29 +0200, pjb@informatimago.com (Pascal J.
Bourguignon) wrote:
>Giorgos Keramidas <keramida@ceid.upatras.gr> 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 :)