[pygccxml-development] Function Transformation - comments
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2006-09-04 07:26:04
|
Good morning. Matthias I reviewed the code and here is my comments. 0. small but important issue: in some places within code you use next convention: wrapperfunc or virtualfunc. Can you separate words by '_'? Thanks. 1. code_creators.mem_fun_v_t and mem_fun_v_wrapper_t I think that for a time being it is better to derive another class from calldef_t and calldef_wrapper_t. There are few reasons I think why it should be done this way: 1. safety - we can play as much as we want, without breaking existing code 2. you added a lot of code to the classes, I think we will better understand the whole feature if it will be separated from the existing code. So I did it for you. I did not add the code you send. 2. I don't understand the role of substitution_manager_t, but I'd like to comment on it's implementation. Why don't you use dictionary and standard Python string substitution mechanism? "%(return_)s" % dict( return_="123" ) Or "..." % self.__dict__ pretty simple, less code and users already knows this technique. 3. I don't understand subst_t hierarchy. For example code_manager_t derives from subst_t. subst_t class perform text substitutions, while code_manager_t manages pieces of source code for a C++ function. It seems that subst_t class should be an implementation details of code_manager_t class. 4. function_transformer_t completely operates on string level. It does not even contain reference to declaration it works on. I expected to see something completely different. I thought about defining hierarchy of "transformation" classes, then the role of function_transformer_t could be an aggregation of all transformations that user want to do for the function to convert it to another function ( 1:1 ). Obviously, user will have to write some "glue code" to help all these transformations to work together and we should find the right place to it. I thought we will define few useful transformations and let the user to extend them. Also, what I did not see is responsibilities and contracts. I mean you wrote documentation but it is not clear from the class interfaces. I hope you will be able to explain me all these things. Please don't stop working on the feature. It is very important and useful. I will try to help as much as I can. Also I will complain and ask stupid questions all the way :-) I just commited few changes that will allow you to continue your work. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |