[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#65516: 30.0.50; Edebug behavior of signaling errors in &or
From: |
Gerd Möllmann |
Subject: |
bug#65516: 30.0.50; Edebug behavior of signaling errors in &or |
Date: |
Sun, 27 Aug 2023 08:26:36 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Stefan Monnier <monnier@iro.umontreal.ca> writes:
(Adding Michael in CC because he might be interested.)
>> My question is about edebug-no-match. Do you perhaps have an idea what
>> the reason might be why it ever chooses to signal an error instead of
>> just throwing no-match?
>
> `edebug-no-match` is the only place where we test `edebug-gate`, so if
> we make it throw to `no-match` it would make `gate` into a no-op.
Yes.
> (`gate` doesn't occur explicitly in your example, but it's implicitly
> present inside other things like `&define`, and hence `def-form`,
> IIRC).
Correct.
> In a sense `gate` is supposed to be a bit like Prolog's "cut", but
> Edebug isn't quite like Prolog (e.g. it doesn't really do backtracking;
> it works more like a PEG parser) and similarly its `gate` isn't the same
> as "cut".
Right.
> See bug#41988 for a case where we didn't want a failure in one
> "definition form" to be allowed to continue matching in a second branch
> of an `&or` (tho this was arguably because some of the code executed
> along the way had side-effects that can't be undone).
Hurrah! :-) Yes, that's it! Thank you so much, that made my day!
As a fix, I'd like to propose to remove 'gate' as a debug spec entirely.
Reasons are:
- I doubt it's very useful to signal invalid-read-error while matching.
In fact, I found it very confusing, when I got it, wondering how the
Lisp reader comes into play here. And the signal didn't give me any
helpful info either.
- I can't imagine anyone using 'gate' as it is. I just don't see a
use-case for it.
I know that could be considered radical. But, so what?
WDYT?
- bug#65516: 30.0.50; Edebug behavior of signaling errors in &or, Gerd Möllmann, 2023/08/25
- bug#65516: 30.0.50; Edebug behavior of signaling errors in &or, Gerd Möllmann, 2023/08/26
- bug#65516: 30.0.50; Edebug behavior of signaling errors in &or, Stefan Monnier, 2023/08/26
- bug#65516: 30.0.50; Edebug behavior of signaling errors in &or,
Gerd Möllmann <=
- bug#65516: 30.0.50; Edebug behavior of signaling errors in &or, Stefan Monnier, 2023/08/27
- bug#65516: 30.0.50; Edebug behavior of signaling errors in &or, Gerd Möllmann, 2023/08/28
- bug#65516: 30.0.50; Edebug behavior of signaling errors in &or, Stefan Monnier, 2023/08/28
- bug#65516: 30.0.50; Edebug behavior of signaling errors in &or, Gerd Möllmann, 2023/08/29
- bug#65516: 30.0.50; Edebug behavior of signaling errors in &or, Stefan Monnier, 2023/08/29
- bug#65516: 30.0.50; Edebug behavior of signaling errors in &or, Gerd Möllmann, 2023/08/30
- bug#65516: 30.0.50; Edebug behavior of signaling errors in &or, Stefan Monnier, 2023/08/27
- bug#65516: 30.0.50; Edebug behavior of signaling errors in &or, Michael Heerdegen, 2023/08/27
- bug#65516: 30.0.50; Edebug behavior of signaling errors in &or, Stefan Monnier, 2023/08/27
- bug#65516: 30.0.50; Edebug behavior of signaling errors in &or, Gerd Möllmann, 2023/08/28