GNU bug report logs -
#47677
[PATCH] condition-case success continuation
Previous Next
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
View this message in rfc822 format
Mattias Engdegård <mattiase <at> acm.org> writes:
> (condition-case x
> (throw 'meep 2)
> ((:catch 'meep) (+ x 3)))
> => 5
>
> Multiple catch and error handlers can be mixed freely in the same
> `condition-case` form, which can also include a :success clause.
Sorry; I'm not very enthusiastic about this construct -- it just seems
like an awkward hack to me.
condition-case is about handling errors -- it can be used as a general
flow control system, but that's an awkward fit. It conveys intention.
So I don't think we should extend it to handle more throw/catch-like
things.
However, I do agree that Emacs Lisp could need some beefing up in the
"early return" department (which this is a kind of example of), but I
don't know what that would look like. But I don't think it should look
like this.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
This bug report was last modified 4 years and 19 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.