bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#48585: 28.0.50; Missing Edebug instrumentation for some 'if-let' var


From: Stefan Monnier
Subject: bug#48585: 28.0.50; Missing Edebug instrumentation for some 'if-let' variants
Date: Sat, 16 Jul 2022 18:25:55 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

>> The 'symbolp' specification element causes Edebug to not instrument the
>> 'x' symbol.  However, the 'symbolp' specification is also necessary
>> here; we couldn't just replace it with 'form' because that would make
>> the branches overlap.  What we'd need here is something like
>> [&and symbolp form], i.e. match only in case of a symbol, but also
>> instrument as a form.  IIUC Edebug doesn't support such constructs yet.
>
> Perhaps Stefan has some comments here; added to the CCs.

The instrumentation takes place before expanding the macro, so either we
instrument the `x` into a form (edebug-<foo> ... x ...) or we leave the
`x` untouched and have no instrumentation.  We can't have it both ways
from that side.

So if we want the occurrence of `x` which *evaluates* `x` (as opposed to
the occurrence that *binds* the new variable) to be instrumented, we
need to change the macro to accept a "variable name" of the form
(edebug-<foo> ... x ...) and somehow strip the edebug instrumentation
when we use the argument as a variable name in a binding position.

As someone who doesn't much like `if-let`, I'll let someone else figure
out how to that somewhat cleanly.  Also to be honest I also wonder if
that would be worthwhile.


        Stefan






reply via email to

[Prev in Thread] Current Thread [Next in Thread]