On Sat, Jan 5, 2013 at 7:55 AM, Nick Wellnhofer <[email protected]> wrote:
> On Jan 5, 2013, at 04:22 , Marvin Humphrey <[email protected]> wrote:
>> If I understand you correctly, +1 for the second option, yielding something
>> like this in cfc.c:
>>
>>   CFCC *c_binding = CFCC_new(hierarchy, parcel, header, footer);
>>   CFCC_write_callbacks(c_binding);  // <------- callbacks.h written here
>>   CFCC_write_boot(c_binding);
>>   CFCC_write_bindings(c_binding);
>
> This works well for the C bindings but I was thinking more about other host
> languages. callbacks.h should be identical for all of them, so it would be
> nice if the code that generates the file doesn't have to be duplicated.

I see.  To avoid a DRY problem where we duplicate the code which generates
callbacks.h in every host except C, we want to put the code in a common
location.  Sounds good.

With that clarification in mind, I'd like to reaffirm my support for option
number 2:

    2. Let the host language code in CFC trigger the creation of callbacks.h.
       This would probably mean to instantiate another temp CoreBind object in
       the host language code for this task.

CFCBindCore seems like a fine place to put the common code.  The temp object
is no big deal, since we're just going to reuse the CFCHierarchy object.

Marvin Humphrey

Reply via email to