Skip to content

How to make result of variadicsForEach be comma-separated #29

Closed Answered by Hirrolot
pdietl asked this question in Q&A
Discussion options

You must be logged in to vote

Hi! Perhaps the easiest solution would be:

// Same...

#define ENUMERATE(c) c,

#define ENUM_PRINTABLE(name, ...) \
    typedef enum {  \
        ML99_EVAL(ML99_variadicsForEach( \
            ML99_compose(ML99_reify(v(ENUMERATE)), ML99_appl(v(ENUM_CONSTANT), v(name))), \
            v(__VA_ARGS__))) \
    } name##_t; \
 \
    /* Same... */

// Same...

The function main prints The color is kColor_Red on my end.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by pdietl
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants