5 Sep 11:28
Proposal for Include files/headers
edA-qa <edA-qa <at> disemia.com>
2004-09-05 09:28:20 GMT
2004-09-05 09:28:20 GMT
Rather than use the old C style of just #include I would recommend a better manner of handling dependencies. If you watch the C++ standards discussions you'll also realize there technically is now no really portable way of using header files, since there is a lack of clarity between #include <file> and #include "file". What would be nice is a Java style import system, which makes it easier for new users, and can remove the problem of ordering of dependencies. (The #include system should also remain since it has other uses than resolving dependencies). Example: #import Math.Matrix //get a single definition #import Http //get entire namespace The implementation then needs a resolution system for importing. This works similar to includes files, but there are "Import" directories. Each namespace is translated to a directory and filename. Beforehand the compiler can't know whether it is a namespace or a class or symbol, so it has to try all possibilities. So in the above, the searching for the above might look like: 1. search for: importDirN/Math/Matrix/all.imp 2. search for: importDirN/Math/Matrix.imp 3. search for: importDirN/Math/all.imp 4. end search(Continue reading)
RSS Feed