Re: compilation cascades and new Fortran features



It is not just a matter of doing something incorrect. A user
might, for example, want to update a comment in the file
containing the specification part of a module.

Also, some existing Fortran 95 compilers inline references
to small module procedures. People using such
implementations might not want to pay the performance
hit for moving those module procedures into separate
implementation files.

I agree that programmers can help themselves a lot by
assigning modules to files in an orgainized way. In
almost all cases, each module should be in a separate
source file. There should be no other code in the file.
The basename of the source file should be the same as
the basename of the generated .mod file.

Bob Corbett

.



Relevant Pages

  • Semantic difference of source files
    ... programming languages encourage the programmer to separate their interfaces ... compare AST's (if the source file is newer). ... The big bonus is that you may also, quite easily, separately compare the ... You need to save a representation of the AST when compiling. ...
    (comp.compilers)
  • Re: how to know if i am in a module or in the main script ?
    ... I still claim laziness being the motive to not separate these ... stemming from my preference to separate concerns ... keeping test code in the library source file as "keeping related things together", which is an equally good principle. ... Now, in many cases it may be better, or even necessary, to keep tests separate from the code, but I think it makes a lot of sense to keep basic functionality tests in same source file as the module they're testing. ...
    (comp.lang.ruby)