I want a simple way to have:
\reverseit{abc defg \mycommand}
yield
\mycommand gfed cba
?
(Yes, the original motivation is related to Hebrew and RTL languages, but that can sort of be solved using \beginR ... \endR/\beginL ... \endL where necessary without changing the language. So I'm asking the general question.)
Edit: The solution in this question is acceptable as a non-LaTeX-3 solution...
\mycommandis lost. – user202729 Jun 27 '22 at 08:23\mycommand gfed cbaconsist of\mycommand gfed␣cba(only one explicit space token) instead of the intended\mycommand ␣gfed␣cba. – user202729 Aug 04 '22 at 16:33