Can you do something like this with a macro in C?
#define SUPERMACRO(X,Y) #define X Y then SUPERMACRO(A,B) expands to #define A B <
#define SUPERMACRO(X,Y) #define X Y then SUPERMACRO(A,B) expands to #define A B
You cannot define macros in other macros, but you can call a macro from your macro, which can get you essentially the same results.
#define B(x) do {printf("%d", (x)) }while(0) #define A(x) B(x)
so, A(y) is expanded to do {printf("%d", (y)) }while(0)
A(y)
do {printf("%d", (y)) }while(0)