On Wed, Nov 2, 2011 at 5:31 PM, <[email protected]> wrote: > OK to use a macro to generate these, but there's no need for the > higher-order macro (which isn't undef'd here, kind of scary). It isn't > much worse to have > > #define FIELD_ACCESSORS(index, name) \ > ... > FIELD_ACCESSORS(FLAGS, flags) > FIELD_ACCESSORS(NUM_**PARAMETERS, num_parameters) > ... > #undef FIELD_ACCESSORS > > Where I've taken advantage of the default being 0 for all of them and of > the ability to generate the _INDEX part of the name in the macro. > > And if you switch to CamelCase for the functions and kConstantStyle for the enum tags, you only need one name, which is nice because "index" is not a number but a string and that is confusing:
FIELD_ACCESSORS(Flags) FIELD_ACCESSORS(ParameterCount) ... -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
