uh311ae@sun7.lrz-muenchen.de (Henrik Klagges) (11/02/90)
ARRGH ! I want C & C++ to implement a name-space policy that can be validated ! I tried to build a very big package and found the linker complaining about this and that being undefined. With all these nested #includes, the final solution was: grep <undefined-stuff-here> /usr/include/* 8( 8( 8( grep <undefined-stuff-here> /usr/local/include/* 8( 8( 8( grep <forever> I want: #include <stdio.h::printf> printf("This is printf explicitly included.\n"); and #include <stdio.h> stdio.h::printf("This is printf implicitly (with stdio.h) included.\n"); stdio.h::printf("Therefore the name has to preceded with the header name.\n"); This would solve a lot of problems, including the monolithic-class-libraries' designers desire to call his root class "object". Comments, please. Yours, Henrik Klagges Scanning tunnel microscope group at LMU Munich. uh311ae@sun7.lrz-muenchen.de
jfischer@sco.COM (Jonathan A. Fischer) (11/06/90)
In article <5299@tuminfo1.lan.informatik.tu-muenchen.dbp.de> uh311ae@sun7.lrz-muenchen.de () writes: >I want: > >#include <stdio.h::printf> > >printf("This is printf explicitly included.\n"); > >and > >#include <stdio.h> > >stdio.h::printf("This is printf implicitly (with stdio.h) included.\n"); >stdio.h::printf("Therefore the name has to preceded with the header name.\n"); > >This would solve a lot of problems, including the monolithic-class-libraries' >designers desire to call his root class "object". It's a bad idea to add such a major hack to the language itself to solve what is fundamentally a problem in the class libraries (for example). I agree that namespace pollution is and will be one of the big nuisances of C++ programming, specifically the careless use of such basic names as Object, Atom, World, etc. by class designers. The solution? Why not use: NIH_Object - the Object class in the NIH Class Library X11_Atom - an X11 Atom structure (the problem exists in C too!) IV_World - InterViews World class... A scenario: you buy class libraries A and B from two different vendors. Without source. How likely is it that you will be able to freely mix and match objects from these two libraries in the same program?? Given current practice, not too likely, I'd say.