I'm once again caught thinking about how much nicer things could be if the #C preprocessor were just a little more... like a usual programming language.

And it seems like something that could have very easily happened, historically. It seems *so* possible that in like 1988 RMS said "It would be a huge win if I could `#defun (...)` and define a C macro in LISP instead of the existing macro language."

Getting macros for Emacs right is an abysmal pita, as the output of the macro must be valid Elisp code. This usually requires a wild mix of expansion/evaluation or not of the macro parameters in the right places. If you have not done this for the last umpteen years, you will (no subjunctive, you WILL) screw up first.

To make the task a easier I tried a macro to (a) dump the macro expansion of your macro and (b) let it go wild.

https://codeberg.org/harald/Codeschnipselnotizen/src/branch/main/elisp/tracemacro.el

#elisp #emacs #defun #defmacro #codeberg

Codeschnipselnotizen/elisp/tracemacro.el at main

Codeschnipselnotizen - Code snippets and notes

Codeberg.org