GNU bug report logs - #47677
[PATCH] condition-case success continuation

Previous Next

Package: emacs;

Reported by: Mattias Engdegård <mattiase <at> acm.org>

Date: Fri, 9 Apr 2021 20:28:02 UTC

Severity: wishlist

Tags: patch

Done: Mattias Engdegård <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


Message #99 received at 47677 <at> debbugs.gnu.org (full text, mbox):

From: Gregory Heytings <gregory <at> heytings.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: Stefan Kangas <stefan <at> marxist.se>, Lars Ingebrigtsen <larsi <at> gnus.org>,
 Filipp Gunbin <fgunbin <at> fastmail.fm>, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 47677 <at> debbugs.gnu.org
Subject: Re: bug#47677: [PATCH] condition-case success continuation
Date: Tue, 27 Apr 2021 19:00:53 +0000
>
> Unrelated to your comment: since several people have misunderstood the 
> proposal, I'm closing the bug
>

I guess you did not see my previous post in this bug thread.

This bug should not be closed.  I agree with Richard and Eli, it is not 
necessary to add that feature to Elisp, the more so as it can be 
implemented with a short macro:

(defmacro if-success (var action continuation &rest handlers)
  "Regain control when an error is signaled, otherwise continue.
Execute ACTION and, if no error happened, CONTINUATION, with VAR
bound to the return value of ACTION.
Otherwise, execute the appropriate HANDLER, with VAR bound to
(ERROR-SYMBOL . SIGNAL-DATA)."
  `(catch 'success-case-failure
     ((lambda (,var) ,continuation)
      (catch 'success-case-success
        (throw 'success-case-failure
               (condition-case ,var
                   (throw 'success-case-success ,action) ,@handlers))))))




This bug report was last modified 4 years and 18 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.