Defining formatting styles for Fortran

For modules, I usually prepend the name of the package, I got to like this pattern at stdlib, as it feels more natural.

! src/something/foo.f90
module something_foo

    private
    public foo

contains

    subroutine foo()
        write(*,*) 'foo'
    end subroutine

end module

Parsing is hard, ambiguity, I know: but the point stills valid.
The fact that we have ambiguity in “- (binary)” and “- (unary)” didn’t stop someone to pursue that feature.
I wonder if a name in module name statements would appear in any other context other than in use statements. A more honest answer should be is harder to implement as we don’t have much help in compilers, right?

2 Likes