This macro is a repetition construct.
If
list is (
a, (
b, (
c,
BOOST_PP_NIL))), it expands to the sequence:
macro(r, data, a) macro(r, data, b) macro(r, data, c)
#include <boost/preprocessor/list/adt.hpp>
#include <boost/preprocessor/repetition/for.hpp>
#include <boost/preprocessor/list/for_each.hpp>
#define LIST (x, (y, (z, BOOST_PP_NIL)))
#define MACRO_2(r, data, elem) elem
#define PRED(r, state) BOOST_PP_LIST_IS_CONS(state)
#define OP(r, state) BOOST_PP_LIST_REST(state)
#define MACRO(r, state) [ BOOST_PP_LIST_FOR_EACH_R(r, MACRO_2, _, state) ]
BOOST_PP_FOR(LIST, PRED, OP, MACRO)
// expands to [x y z] [y z] [z]