unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Rupert Swarbrick'" <rswarbrick@gmail.com>, <help-gnu-emacs@gnu.org>
Subject: RE: What to use instead of find-if?
Date: Tue, 2 Dec 2008 16:58:45 -0800	[thread overview]
Message-ID: <005001c954e2$4b935a60$0200a8c0@us.oracle.com> (raw)
In-Reply-To: <gh4juo$vas$1@news.albasani.net>

> > There are no doubt lots of ways to do it. Here's one:
> > (defun my-find-if (pred xs)
> >   (catch 'my-found
> >     (dolist (x xs) (when (funcall pred x) (throw 'my-found x)))
> >     nil))
> 
> Ahah. That's neat! (And is indeed the semantics I had in mind when I
> wrote the original).
> 
> Now, this really isn't relevant to the original question, but 
> I was just wondering: what are the performance costs of (catch )
> in elisp? For example, should one think twice before using it in
> syntax highlighting code or the like?

Sorry, I can't answer that.
My guess is that it is very performant.

I know that I don't think twice about using it.
But then I don't think twice about a lot of things. ;-)





  reply	other threads:[~2008-12-03  0:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-01 19:56 What to use instead of find-if? Rupert Swarbrick
2008-12-01 21:24 ` Drew Adams
     [not found] ` <mailman.1649.1228166673.26697.help-gnu-emacs@gnu.org>
2008-12-03  0:29   ` Rupert Swarbrick
2008-12-03  0:58     ` Drew Adams [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-12-01 19:54 Rupert Swarbrick

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='005001c954e2$4b935a60$0200a8c0@us.oracle.com' \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=rswarbrick@gmail.com \
    /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).