@pkw @galdor @louis

(The paraphrase of me is fine.)

Dan Halbert did some work on a tool called that allowed useful stepping of macro-written code by adding some operations that basically said (I don't recall exactly, so I'm also paraphrasing from very old and error-prone memory, including the names of operators, which I'm just making up as approximations here) STEP-WITHIN and DONT-STEP-WITHIN, so that you could mark which regions of code in a macro expansion were just infrastructure and which had come from the user and were probably intended to be stepped. It was his 1978 thesis titled "A Lisp Debugger for Display Terminals", but I was not able to find an online reference. This seemed like good work, and I was always sad it did not find a home in the community at large because issues related to it come up now and then.

Although as I recall some of the early work on hygienic macros differed in whether syntax (grammars) were used to express things or whether there were syntactic closures by Bawden & Rees (https://dspace.mit.edu/bitstream/handle/1721.1/6036/AIM-1049.pdf?sequence=2&isAllowed=y). Using this approach, and maybe also the syntax-driven approaches, it seems obvious which parts are the steppable part since they come from the unexpanded parts of the macro, while the other parts arise from the expansion.

The beauty of Halbert's approach was that it would work even in a non-hygienic situation by just adorning the parts you wanted to be able to step. And if you always used backquote to contruct your results, a modified backquote that just injected something that enabled stepping every time you used a comma, and wrapped the whole thing with a don't step, you'd get something that was a fairly close approximation. I'm handwaving, so ask me if the problem or solution I'm describing is not clear.

Here's yet another reference based on work by Glen Parker that I wasn't recalling but that turned up in a search and might be useful. It references Halbert's work, which is how I found it in the search.
https://dl.acm.org/doi/pdf/10.1145/1317216.1317217

@kentpitman @pkw @[email protected] @[email protected]

Hi - Kent pointed me to this post. The source code for DIDL (DIDL Is a Debugger for Lisp) is available here: https://www.saildart.org/allow/DIDL%5bMAC,LSP%5d. My 1978 bachelor's thesis is not online, but I will scan it and put it up very soon, and reply when it's available.

DIDL[MAC,LSP] - www.SailDart.org

Dan Halbert