Variadic macros in CPP (the C/C++ preprocessor; for simplicity's sake I'll treat it as a single, separate language in this question) are extremely limited compared to, e.g., C++'s variadic templates. Essentially, variadic macros are just macros with a parameter whose argument is allowed to contain commas. This provides no straightforward way to count arguments, operate on arguments one by one, etc. Those things are possible, but require elaborate, confusing, and slow-to-compile hacks, such as those described in this question. The only thing that's anywhere near straightforward to do with VA_ARGS
is pass them to a variadic function.
My question is, why were they designed this way? The standard approach to lists in any pure-functional language like CPP is cons-style pattern matching: handle the first argument of a list and recurse for the rest, and have a base case for the empty list. The standards committee members would have been quite familiar with this approach.
Why was an approach like this not taken with CPP's variadic macros? Were variadic macros seen as simply a way to wrap variadic functions, such that there was no need to operate on the argument list? Was there some underlying issue that would have made it impractical to allow variadic macros to recurse? Or...?
NOTE: I'm not looking for answers/comments of the form "because people shouldn't want variadic macros". The existence of things like boost.preprocessor indicates that reasonable people wanted to use the preprocessor in non-trivial ways. Also not looking for personal opinions on why some other design would be a good/bad idea. I'm trying to find out the actual reasoning from the time.