Re: [pygccxml-development] FT - name uniqueness
Brought to you by:
mbaas,
roman_yakovenko
From: Matthias B. <ba...@ir...> - 2006-10-12 09:40:16
|
Roman Yakovenko wrote: > On 10/11/06, Matthias Baas <ba...@ir...> wrote: >> Right. And as long as the alias is used for the wrapper names (which is >> currently the case) the above problem doesn't exist. > > You are wrong. Consider next case: > > struct window{ > void get_size( int&, int& ); > }; > > struct image{ > void get_size( int&, int& ); > }; > > What you propose will force user always specify a function alias. 1. I was not proposing anything at all, I was just describing the current situation which I think is not that bad (I'd just like to avoid that a "fix" will automatically produce code that compiles but that makes one function inaccessible. For me, this would be worse than the current situation). 2. Your initial mail was dealing with functions that are inside the same scope. The above code should be no problem at all as the class name is incorporated into the wrapper name as well when the wrappers are free functions. If you have an example where this is not the case, then this might be a bug. >> The question may then rather be: who should report the error, Py++ or >> the compiler? I think it's desirable that Py++ notices this situation >> and can issue an error, but I don't think it's a good idea to mangle the >> name so that the code compiles but produces functions that could not be >> called because they are shadowed by other functions. > > Generated code should work. And it is possible to achieve this. Without that the user assigns an alias? How will you do that? If you use the same name to register two different functions that have the same signature then one of those functions is not accessible in Python. How should Boost.Python distinguish between the two? - Matthias - |