Re: True Name Spaces, when?



Henrick Hellström wrote:
Marc Rohloff [TeamB] wrote:

The circular reference problem has nothing to do with namespaces.

Alef has demonstrated he is perfectly capable of speaking for himself, but I guess a point to be made is that in Delphi you can only have two class declarations contain references to each other if they both are declared in the same unit with the proper forward declarations. In C# you don't need forward declarations and can therefore put such classes in different units. (Which, of course, comes at the price of slower compilation.)

Yes, but Marc probably meant that the problem with circular references is more an artifact of single-pass compiling.
Andreas Hausladen once suggested an easy way to solve it by kinda explicitly doing a forward declare for types in other units.
OTOH, I do not think that the programmer should do the job of the compiler. Resolving types is its job, not mine.
Two passes are more than enough. The first quick one to fetch all types names in their units.
Then the normal pass but now with infos about all types.
Whoever brings arguments like comparing the compilation time with C++ has either absolutely no idea, or simply does not want change for the sake of not wanting to have any change...

This is 2008, not 1978. Single-pass compilation is so 30 years ago.
.



Relevant Pages

  • Re: C++ sucks for games
    ... In the event of sufficient declarations and inference unboxed ... > compilation is performed. ... subset to C translator like Thinlisp (which currently does fixnums ... does this), where the first word is a giant tag bit, and the other ...
    (comp.lang.lisp)
  • Re: Linking fails
    ... that would lead to a compilation ... function declarations. ... be found in the files being linked, including any libraries used. ... you do need to include the correct header, because that is the only place ...
    (comp.lang.c)
  • .H, .CPP files, differences in linker behavior 2002 vs 2003
    ... I am having linker errors: ... declarations in duplicated types ... I do not declare some PRIVATE: data members in the .H file, ... does not affect the other module compilation. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: [PATCH] softlockup: show irqtrace
    ... I admit to having improved the process of compilation ... about implicit declarations (which would otherwise show up as linker ... hassle with patches submitted to -tip - especially with small patches ... every single patch added to the repository. ...
    (Linux-Kernel)