[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#47677: [PATCH] condition-case success continuation
From: |
Lars Ingebrigtsen |
Subject: |
bug#47677: [PATCH] condition-case success continuation |
Date: |
Sun, 25 Apr 2021 18:45:31 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Mattias Engdegård <mattiase@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
- bug#47677: [PATCH] condition-case success continuation, (continued)
- bug#47677: [PATCH] condition-case success continuation, Richard Stallman, 2021/04/26
- bug#47677: [PATCH] condition-case success continuation, Eli Zaretskii, 2021/04/26
- bug#47677: [PATCH] condition-case success continuation, Richard Stallman, 2021/04/26
- bug#47677: [PATCH] condition-case success continuation, Filipp Gunbin, 2021/04/26
- bug#47677: [PATCH] condition-case success continuation, Mattias Engdegård, 2021/04/27
- bug#47677: [PATCH] condition-case success continuation, Gregory Heytings, 2021/04/27
- bug#47677: [PATCH] condition-case success continuation, Filipp Gunbin, 2021/04/29
- bug#47677: [PATCH] condition-case success continuation,
Lars Ingebrigtsen <=
- bug#47677: [PATCH] condition-case success continuation, Mattias Engdegård, 2021/04/26
- bug#47677: [PATCH] condition-case success continuation, Richard Stallman, 2021/04/26
bug#47677: [PATCH] condition-case success continuation, Gregory Heytings, 2021/04/26