From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: condition-case
Date: Thu, 16 Dec 2010 17:03:26 -0500 [thread overview]
Message-ID: <jwvwrn9xtph.fsf-monnier+gnu.emacs.help@gnu.org> (raw)
In-Reply-To: 877hfbx9nl.fsf@lifelogs.com
> OK, so would it work as:
> (defmacro handler-case (expression &rest clauses)
> "Evaluate expression with `condition-case' and catch errors with CLAUSES.
> Longer explanation here..."
> (let* ((var (gensym))
> (neclause (assoc :NO-ERROR clauses))
> (nell (cadr neclause))
> (nebody (cddr neclause))
> (handlers (mapcar (lambda (clause)
> (let ((typespec (car clause))
> (clausvar (cadr clause))
> (body (cddr clause)))
> (cons (if (and (consp typespec)
> (eq 'or (car typespec)))
> (cdr typespec)
> typespec)
> (if (null clausvar)
> body
> (let ((var (car clausvar)))
> body)))))
You need backquotes around the let.
> Does that new `let' that pops the clause need to evaluated? And should
> it maybe be a `lexical-let'?
Whether it should be lexical or not is up to you.
Stefan
prev parent reply other threads:[~2010-12-16 22:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <33e7a222-992c-4fc2-bbd2-d987a0d4d9b1@j32g2000prh.googlegroups.com>
2010-11-28 23:44 ` Fwd: condition-case Fren Zeee
2010-11-29 1:25 ` Glenn Morris
[not found] ` <877hfxokvh.fsf@lola.goethe.zz>
[not found] ` <4d4ecf83-ffd8-43d9-8c27-4123856273e9@21g2000prv.googlegroups.com>
[not found] ` <0b6e72ef-a605-4ac1-bc71-f3e180f162fb@j18g2000prn.googlegroups.com>
[not found] ` <87r5e3zxyw.fsf@kuiper.lan.informatimago.com>
[not found] ` <878w06lqcf.fsf@lifelogs.com>
[not found] ` <8762vaodaw.fsf@kuiper.lan.informatimago.com>
[not found] ` <8762v6ho6q.fsf@lifelogs.com>
[not found] ` <jwv62v6ljkb.fsf-monnier+gnu.emacs.help@gnu.org>
[not found] ` <87hbepd50p.fsf@lifelogs.com>
[not found] ` <jwvmxohh8yt.fsf-monnier+gnu.emacs.help@gnu.org>
[not found] ` <87pqtc9sd5.fsf@lifelogs.com>
[not found] ` <jwvbp4v9enz.fsf-monnier+gnu.emacs.help@gnu.org>
2010-12-10 18:40 ` condition-case Ted Zlatanov
2010-12-10 21:43 ` condition-case Stefan Monnier
2010-12-13 17:12 ` condition-case Ted Zlatanov
2010-12-13 17:10 ` condition-case Ted Zlatanov
2010-12-15 4:55 ` condition-case Stefan Monnier
2010-12-15 16:50 ` condition-case Ted Zlatanov
2010-12-16 22:03 ` Stefan Monnier [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvwrn9xtph.fsf-monnier+gnu.emacs.help@gnu.org \
--to=monnier@iro.umontreal.ca \
--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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.