[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#65620: void function edebug-after
From: |
Gerd Möllmann |
Subject: |
bug#65620: void function edebug-after |
Date: |
Thu, 31 Aug 2023 10:02:18 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Gerd Möllmann <gerd.moellmann@gmail.com> writes:
> Michael Heerdegen <michael_heerdegen@web.de> writes:
>
>> Alan Mackenzie <acm@muc.de> writes:
>>
>>> (defmacro hash-if (condition then-form &rest else-forms)
>>> "A conditional compilation macro analogous to C's #if.
>>> Evaluate CONDITION at macro-expansion time. If it is non-nil,
>>> expand the macro to THEN-FORM. Otherwise expand it to ELSE-FORMS
>>> enclosed in a `progn' form. ELSE-FORMS may be empty."
>>> (declare (indent 2)
>>> (debug (form sexp &rest sexp)))
>>> (if (eval condition lexical-binding)
>>> then-form
>>> (cons 'progn else-forms)))
>>
>> Dunno if someone is able to fix this (I'm not). Until then using
>> `def-form` `or `sexp` instead of `form` works in a better way (the
>> former edebugs CONDITION when instrumenting, the latter would omit
>> edebugging the CONDITION entirely).
>>
>> Anyway, the key point in the above example is that macroexpanding (while
>> instrumenting) combined with the `eval' call seems to lead to the
>> evaluation of instrumented code outside of an Edebug session when
>> CONDITION is instrumented using `form`. `eval-when-compile' uses
>> `def-form` for example - I guess using `form` in this case doesn't work
>> as one might expect.
>
> I think what's happening here is like this:
>
> By using 'form' for condition, we're telling edebug to instruments it.
> That is, the argument eval sees when foo is instrumented is whatever
Sorry, "sees" is midleading: eval has as argument ...