From: Ted Zlatanov <tzz@lifelogs.com>
To: help-gnu-emacs@gnu.org
Subject: Re: condition-case
Date: Fri, 10 Dec 2010 12:40:06 -0600 [thread overview]
Message-ID: <877hfh4gl5.fsf@lifelogs.com> (raw)
In-Reply-To: jwvbp4v9enz.fsf-monnier+gnu.emacs.help@gnu.org
On Thu, 09 Dec 2010 10:04:12 -0500 Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> Here's what Pascal posted originally.
SM> The code looks fine (tho it needs a reindent to follow Elisp
SM> convention). The docstring needs a completely rewrite, OTOH, to follow
SM> Elisp convention: first line should succintly describe the macro, and
SM> the rest should give details about what it does and what each
SM> param means. I.e. someone not familiar with Common-Lisp should be able
SM> to understand how to use it.
Yes, that's not hard. I was worried about the code's behavior.
>> (subst var (car clausvar) body)))))
SM> Oh wait, I just noticed this one: `subst' is wrong here. I know CL
SM> already uses it for similar purposes elsewhere, but it's simply wrong
SM> because `subst' doesn't know about Elisp binding rules.
SM> So (subst 'b 'a '(lambda () '(a b c))) will happily return
SM> (lambda () '(b b c)). Better simply use `let', even if it has
SM> a performance cost.
I didn't catch that. I don't know enough about ELisp vs. CL scoping and
binding rules to write this properly, unfortunately. Can you show how
`let' could be used? I'll take the code and provide the doc string and
reindent it, then propose the revised version in emacs-devel.
On Thu, 09 Dec 2010 05:34:02 +0100 "Pascal J. Bourguignon" <pjb@informatimago.com> wrote:
PJB> Ted Zlatanov <tzz@lifelogs.com> writes:
>> Here's what Pascal posted originally. I tested it a little and it seems
>> to work OK; it's basically syntactic sugar but pretty pleasant. We
>> should also consider `handler-bind' which is like `handler-case' but
>> executes handlers directly. Pascal, do you have an implementation of
>> that as well?
PJB> There's no condition-bind to wrap over.
PJB> I'm not sure it would be possible to implement handler-bind without
PJB> patching the virtual machine.
Stefan, WDYT? Is `condition-bind' possible in today's GNU Emacs? I
mean does the VM have any constraints that would block it?
Ted
next prev parent reply other threads:[~2010-12-10 18:40 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 ` Ted Zlatanov [this message]
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 ` condition-case Stefan Monnier
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=877hfh4gl5.fsf@lifelogs.com \
--to=tzz@lifelogs.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.
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.