#include <boost/preprocessor/cat.hpp> #include <boost/preprocessor/list/fold_left.hpp> #define L1 (a, (b, (c, BOOST_PP_NIL))) #define L2 (L1, (L1, (L1, BOOST_PP_NIL))) #define OP(d, state, x) (BOOST_PP_LIST_FOLD_LEFT_2ND_D(d, OP_2, _, x), state) #define OP_2(d, state, x) BOOST_PP_CAT(state, x) BOOST_PP_LIST_FOLD_LEFT(OP, BOOST_PP_NIL, L2) /* expands to: (_abc , (_abc , (_abc , BOOST_PP_NIL))) */