Followed by: emacs -Q -L . -batch -f batch-byte-compile my.el emacs -Q -L . -batch -f batch-byte-compile my-tests.el The latter hangs prior to Stefan's limit on recursion. >> >> Perhaps byte-compile--first-symbol-with-pos needs to employ something >> >> like byte-run--ssp-seen? Or does ERT somehow come into play? >> > It wouldn't be difficult, just tedious, to add checking for circular >> > lists into byte-compile--first-symbol-with-pos. But a circular list is >> > an invalid argument for FORM in macorexp-warn-and-return, see above. >> How else should a compiler-macro safely warn about a problematic >> function argument? > > by calling the normal byte compiler warning facilities. Could you please point me to them? > If there is a symbol somewhere in the FORM passed to them, it won't > loop, even if it is a circular list. See the case of my-identity above. > You called macroexp-warn-and-return from outside of the byte compiler. > From within the byte compiler, it cannot generate a loop (see above). What counts as outside of the byte compiler? Do you mean that macroexp-warn-and-return should be disallowed in declare forms or macro definitions? Or that a compiler-macro should not pass forms derived from the function's arguments to macroexp-warn-and-return? AFAIA there is no precedent for such a restriction, and in fact I see the opposite trend in recent history: https://git.sv.gnu.org/cgit/emacs.git/commit/?id=d52c929e31 https://git.sv.gnu.org/cgit/emacs.git/commit/?id=52d5771e0a https://git.sv.gnu.org/cgit/emacs.git/commit/?id=5ee4209f30 https://git.sv.gnu.org/cgit/emacs.git/commit/?id=96926fa6eb https://git.sv.gnu.org/cgit/emacs.git/commit/?id=fffa53ff1a https://git.sv.gnu.org/cgit/emacs.git/commit/?id=bd40ec5d57 https://git.sv.gnu.org/cgit/emacs.git/commit/?id=13d6e8fa54 https://git.sv.gnu.org/cgit/emacs.git/commit/?id=155ddde4dd > Maybe you could construct an example of a circular list without a symbol > from code being compiled. Maybe you could cause a warning from a correct > call of macroexp-warn-and-return to loop. But I'd be surprised. You have repeatedly asserted that macroexp-warn-and-return will not loop if used correctly, but it is not clear to me from your description what correct use of macroexp-warn-and-return entails. Could you please explain? Thanks, -- Basil