From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: Helmut Eller <eller.helmut@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: until-found
Date: Fri, 11 Dec 2009 18:35:33 +0100 [thread overview]
Message-ID: <4B2282E5.7010304@easy-emacs.de> (raw)
In-Reply-To: <m2y6l9h4ox.fsf@gmail.com>
Helmut Eller wrote:
> * 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
>
Ah, fine stuff, thanks a lot!
Andreas
next prev parent reply other threads:[~2009-12-11 17:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.12661.1260449426.2239.help-gnu-emacs@gnu.org>
2009-12-11 16:10 ` until-found Helmut Eller
2009-12-11 17:35 ` Andreas Röhler [this message]
2009-12-10 12:50 until-found Andreas Roehler
2009-12-10 13:58 ` until-found tomas
2009-12-11 10:33 ` until-found Andreas Röhler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B2282E5.7010304@easy-emacs.de \
--to=andreas.roehler@easy-emacs.de \
--cc=eller.helmut@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).