| A simpler explanation of the technique in the article that I believe matches the C standard more closely is the following. Ideally the result of processing a macro ("macro-replacement") would contain no further macros. But in order to disallow infinite loops during processing of a macro, the C standard specifies that names of macros that would be processed recursively are instead painted blue ("marked") so as to never be processed. The technique in the article hinges on the fact that macro-replacement, as specified in the C standard, allows not only for the result of macro-replacement to contain these marked do-not-process macros, but also unmarked unprocessed macros. Specifically, such an unmarked unprocessed macro is a functional macro arising after processing a macro with an empty definition that separates the functional macro's name from its arguments. The technique for achieving recrusive macros is to introduce a functional macro whose definition is the would-be recursive macro, and to replace each occurence of the name of the would-be recursive macro in its own defintion with the functional macro interrupted by an macro with an empty definition. The result is an unmarked unprocessed recursive macro. Processing such a recursive macro, e.g. by including it as an argument to a macro, corresponds to taking one step of the recursion. Thus any pre-determined finite number of steps of a recurisvely defined macro can be performed. For example, the would-be recursive macro of the article #define _COUNT_ONE(x, ...) + 1 _COUNT_TOP(__VA_ARGS__) #define _COUNT_TOP(...) __VA_OPT__(_COUNT_ONE(__VA_ARGS__)) #define COUNT(...) (_COUNT_TOP(__VA_ARGS__) + 0) becomes #define EMPTY #define _COUNT_INDIRECT() _COUNT_ONE #define _COUNT_ONE(x, ...) + 1 _COUNT_TOP(__VA_ARGS__) #define _COUNT_TOP(...) __VA_OPT__(_COUNT_INDIRECT EMPTY()(__VA_ARGS__)) #define COUNT(...) (_COUNT_TOP(__VA_ARGS__) + 0) To process the COUNT(...) macro 5 times, allowing it to count up to 5 variable arguments, nest it 5 levels deep as an argument to a macro. #define EVAL1(...) __VA_ARGS__ #define EVAL5(...) EVAL1(EVAL1(EVAL1(EVAL1(EVAL1)))) EVAL5(COUNT(1,2,3)) |