Is it possible to step through macros with endless recursions in order to realize where the endless recursion occurs?
Found another way.
(define (write-expansion-with-limit n expr)
(when (> n 0)
(let ((expr (syntax->datum (expand-once expr))))
(write expr)
(newline)
(write-expansion-with-limit (- n 1) expr))))
(define-syntax @
(syntax-rules ()
((_ n expr)
(write-expansion-with-limit n 'expr))))