Re: [pygccxml-development] FT - transformer changes
Brought to you by:
mbaas,
roman_yakovenko
From: Matthias B. <ba...@ir...> - 2006-10-13 07:22:44
|
Roman Yakovenko wrote: > On 10/9/06, Roman Yakovenko <rom...@gm...> wrote: >> Hi. I would like to introduce next changes to the FT classes. >> >> 1. rename function_transformer_t to transformer_t and add new class >> function_transformation_t >> Consider next example: >> struct vector3{ >> vector3( int, int, int ){...} >> } >> >> draw_dot( vector3 ){ ... } >> >> User can expose this function as is, but will be able also define >> convenience method >> that takes tuple. >> >> draw_dot( tuple ){ >> internally constructs vector3 from tuple and calls the original >> function. >> } >> >> function_transformation_t will keep list of all transformers that should >> be applied to the function >> >> decl_wrappers.member_function_t will keep a list of all >> function_transformation_t >> >> Obviously the user code, creator_t classes will have to change, but I >> think this is a good >> reason. >> >> 2. rename arg_policies.py file to transformers.py >> >> Get rid of old name >> >> 3. every transformer class should derive from transformer_t >> >> 1. This will introduce "transformer" concept to the Py++. Very, very >> important. >> >> 2. This will allow us to get rid of code >> src = map(lambda cb: getattr(cb, "wrapper_pre_call", defmeth)(self), >> transformers) >> >> 4. every method defined in transformer_t class should return empty string >> and not None. >> >> It will make it clear for user that every redefined method in the >> derived class should return string >> > > Matthias what do you think about these changes? Renaming: If you think the new names make the code clearer then just go ahead. Point 4: I'm fine with that. I guess this makes the code even a bit more fail-safe (provided that the type of the return value is checked and a proper exception is raised!). Point 1 & 3: I can't really comment on those as you don't say what problems these things are trying to solve and how they solve them. It seems to me that these suggestions would lead to a bigger modification of the code that also alters the way the functionality is used. - Matthias - |