From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.help Subject: Re: condition-case Date: Fri, 10 Dec 2010 12:40:06 -0600 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <877hfh4gl5.fsf@lifelogs.com> References: <33e7a222-992c-4fc2-bbd2-d987a0d4d9b1@j32g2000prh.googlegroups.com> <877hfxokvh.fsf@lola.goethe.zz> <4d4ecf83-ffd8-43d9-8c27-4123856273e9@21g2000prv.googlegroups.com> <0b6e72ef-a605-4ac1-bc71-f3e180f162fb@j18g2000prn.googlegroups.com> <87r5e3zxyw.fsf@kuiper.lan.informatimago.com> <878w06lqcf.fsf@lifelogs.com> <8762vaodaw.fsf@kuiper.lan.informatimago.com> <8762v6ho6q.fsf@lifelogs.com> <87hbepd50p.fsf@lifelogs.com> <87pqtc9sd5.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1292010045 24264 80.91.229.12 (10 Dec 2010 19:40:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 10 Dec 2010 19:40:45 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 10 20:40:41 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PR8pd-0000fg-1V for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Dec 2010 20:40:41 +0100 Original-Received: from localhost ([127.0.0.1]:42319 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PR8pc-0006x1-Jz for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Dec 2010 14:40:40 -0500 Original-Path: usenet.stanford.edu!goblin3!goblin1!goblin.stu.neva.ru!news.mixmin.net!news.albasani.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 45 Original-X-Trace: news.albasani.net 5QoBMBklzbVNjtONFDKgAwdcX2nnCL0ynhC7C/mXB7Myfjn1gTS6yImh43xFWg5xGrUJ+EsetuxMgCSJ2gyE4hNFJp1H9YRGJpF8yUcLZ2Mh3zUtSiD8lIOZX7oIct38 Original-NNTP-Posting-Date: Fri, 10 Dec 2010 18:40:06 +0000 (UTC) X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Cancel-Lock: sha1:inYNM9Ej7CtTQHiOWvxJIdcpjys= sha1:RcIXQ1hZ7dW0HJU21gdB+d6eqKM= User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Injection-Info: news.albasani.net; logging-data="Q6+NqbUdIOc5Gya+N55hvDNru9hkTGZKDl7NSm7sTtXRtjK0TMPdl672rtPArb9ZyR9qDX0hiIP3Mj51FqMBR3sf3+IQ5qPFAT3gS9a8l963fQ8mmvGgYpFHjNBhHs0D"; mail-complaints-to="abuse@albasani.net" Original-Xref: usenet.stanford.edu gnu.emacs.help:183148 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:77403 Archived-At: On Thu, 09 Dec 2010 10:04:12 -0500 Stefan Monnier 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" wrote: PJB> Ted Zlatanov 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