In Latex 3 I would like to be write a macro which takes as an argument code which can internally define a macro. How do I do this in a way that allows the code being passed to access arguments of the original. For example I would like to be able to do something like the following.
\documentclass{article} \usepackage{xparse, expl3} \begin{document} \DeclareDocumentCommand{\CodeMacro}{m +m} { Do Something #2 } \CodeMacro{Test} { \DeclareDocumentCommand\csname Testing#1\endcsname{m} { #1-##1 } } \end{document} I would like this to expand to
Do Something \DeclareDocumentCommand\csname TestingTest\endcsname{m} { Test-#1 } 
\expandafter\DeclareDocumentCommand\csname Testing#1\endcsname{}, but you should think about whether this is needed at all. By the way,xparseloadsexpl3already and on document level, you don't useLaTeX 3code at all at the moment