Re: [AD] namespace collision

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Thu, Aug 09, 2001 at 09:50:21PM +1000, Peter Wang wrote:
> Now I'm thinking we should put this whole thing aside for 'Grozilla
> (a.k.a. Allegro 5.0), where we ignore backwards compatibility and
> destroy really International Style glass boxes (they're ugly anyhoo).

Glass boxes?  I'm lost. :)

> Meanwhile, back in the Real World...
> 
> Can I do something about `clear'?  I like the name `clear_bitmap'
> (which, in a Freudianish way, I've typed before).  Here's what I'm
> wanting to change:
> 
> (1) `clear' becomes `clear_bitmap' in source.
> (2) `allegro.h' gets "#define clear(bmp) clear_bitmap(bmp)".
> (3) You can switch off (2) with a #define before #include <allegro.h>.
> (4) People who take the address of `clear' need to use
>     `clear_bitmap' instead.  People who have member functions called
>     `clear' need to do (3) and use `clear_bitmap'.
> 
> Please?

If you like, but (2) is still a problem because of class methods
called `clear' which must not be renamed (it affects the
linking).

If we go for prefixing, we could use inline functions for the
old names, and require the user to use the new names if they
need to do anything dodgy like take the address of a function.
Can you see any problems with this?  The inline versions would
only exist in allegro.h, optionally excluded by setting a
define.  The huge advantage of inline functions is that the
compiler understands context, so we won't damage class methods.

George



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/