I'm looking at a macro, or more likely a combination of macros, that would achieve the following effect :
BRACKET(a) => { a }
BRACKET(a, b) => { a }, { b }
BRACKET(a, b, c) => { a }, { b }, { c }
Sounds pretty simple ? Alas, I couldn't find any reasonable solution. There are possible heavyweight ones, based on counting the nb of arguments, and then creating one dedicated macro for each possible nb of arguments, which felt seriously overkill for the problem at hand (and hard to maintain for the poor successor). But I couldn't find any simpler solution so far.
Edit : Current solution we are trying to improve upon : Uses one macro per list size.
BRACKET1(a) => { a }
BRACKET2(a, b) => { a }, { b }
BRACKET3(a, b, c) => { a }, { b }, { c }
etc.