lucy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marvin Humphrey <>
Subject Re: [lucy-dev] Hiding struct defs
Date Fri, 13 Apr 2012 22:07:28 GMT
On Fri, Apr 13, 2012 at 11:11 AM, Nick Wellnhofer <> wrote:
> On 12/04/2012 18:14, Marvin Humphrey wrote:

>>     void
>>     lucy_init_parcel(void) {
>>         lucy_Bool_init_class();
>>         lucy_Hash_init_class();
>>     }
> CFC could also generate this code this automatically by simply checking
> whether a class has an "init_class" function.

If we autogenerate the parcel-level routine, then the user doesn't get to
control the order in which the class-level init routines get called.

It seems to me as though initialization should be coordinated at the parcel
level because parcels are the load units of Clownfish.

I also think it's good practice to avoid reserving function names and imbuing
them with special meaning if there's another way to achieve the same end.  One
nice thing about ${parcel_prefix}init_parcel is that it can't conflict with
any routines declared in a clownfish class.  (Aside from that, there's nothing
special about the name.)

Marvin Humphrey

View raw message