[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#47677: [PATCH] condition-case success continuation
From: |
Mattias Engdegård |
Subject: |
bug#47677: [PATCH] condition-case success continuation |
Date: |
Sat, 24 Apr 2021 19:02:07 +0200 |
23 apr. 2021 kl. 06.18 skrev Richard Stallman <rms@gnu.org>:
> catch and throw are ok
> as they are, and we should leave them alone.
And so we do! All we do here is to fill a few gaps in the system, but if you
don't feel the need for it then you can just ignore that the new construct
exist.
See the previous discussion for examples, but your code is also a good
illustration:
> (if (catch 'foo
> (prog1 nil
> ...do stuff...)) ;; use (throw 'foo t) to exit
> do-if-throw
> do-if-no-throw)
Here the throw transmits no useful value at all; if it did, this value would
have to be restricted in some way, such as being non-nil. The Lisp
implementation knows very well whether a throw occurred or not, so we can
expose that information instead of having the user hack around the limitation.
Common uses of catch/throw include early exits from deep searches when a match
is found, and then it is useful that the thrown value is unrestricted.
Conversely, when `throw` is used to indicate a failure, it is useful to have
the normal return value unrestricted.
The patch does not include the required documentation changes; naturally that
will be remedied.
- bug#47677: [PATCH] condition-case success continuation, (continued)
- bug#47677: [PATCH] condition-case success continuation, Mattias Engdegård, 2021/04/12
- bug#47677: [PATCH] condition-case success continuation, Lars Ingebrigtsen, 2021/04/13
- bug#47677: [PATCH] condition-case success continuation, Mattias Engdegård, 2021/04/13
- bug#47677: [PATCH] condition-case success continuation, Lars Ingebrigtsen, 2021/04/14
- bug#47677: [PATCH] condition-case success continuation, Mattias Engdegård, 2021/04/15
- bug#47677: [PATCH] condition-case success continuation, Richard Stallman, 2021/04/16
- bug#47677: [PATCH] condition-case success continuation, Richard Stallman, 2021/04/16
- bug#47677: [PATCH] condition-case success continuation, Stefan Kangas, 2021/04/21
- bug#47677: [PATCH] condition-case success continuation, Mattias Engdegård, 2021/04/22
- bug#47677: [PATCH] condition-case success continuation, Richard Stallman, 2021/04/23
- bug#47677: [PATCH] condition-case success continuation,
Mattias Engdegård <=
- bug#47677: [PATCH] condition-case success continuation, Richard Stallman, 2021/04/25
- bug#47677: [PATCH] condition-case success continuation, Eli Zaretskii, 2021/04/25
- bug#47677: [External] : bug#47677: [PATCH] condition-case success continuation, Drew Adams, 2021/04/25
- bug#47677: [External] : bug#47677: [PATCH] condition-case success continuation, Eli Zaretskii, 2021/04/25
- 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