4 ms·
For Lisp macros, there is a macrostep plugin for Emacs that expands a macro within the text of your source code one step at a time until there's nothing left to
by trealira 3y ago
For Lisp macros, there is a macrostep plugin for Emacs that expands a macro within the text of your source code one step at a time until there's nothing left to be expanded. This is temporary, so after you exit the macrostep mode, the source code viewer goes back to normal.
Lisp is dynamically typed, so it's not the same as C++ templates or the Rust type system, but to me, it seems like there isn't a reason in principle why you couldn't make a stepper for pure C++ template metaprogramming, like this Peano arithmetic implementation: https://gist.github.com/vladris/2dc4f5a47d003da002a70f0c0184b0a3 https://gist.github.com/vladris/2dc4f5a47d003da002a70f0c0184...
Particularly for "using" declarations, like this (taken from the gist that I linked):
// A few numbers...
using one = succ<zero>;
using two = succ<one>;
using three = succ<two>;
using four = succ<three>;
using five = succ<four>;
Also, the clangd language server expands C preprocessor macros, but that's less useful because the C preprocessor doesn't allow recursive macros.