In Python the recommended way to use a Numpy function is to write
import numpy as np
and then prefix the NumPy functions when used, for example np.dot
. (Or just import numpy
and numpy.dot
.) Has something similar been considered for Fortran? One can write
use m, only: foo, bar
instead of just use m
, but the reader of a module still needs to look at the top of the module for the relevant use
statement to see where an invoked procedure is coming from. Also currently possible is
use m, only: foo => m_foo, bar => m_bar
Would it make sense to allow something like
use m
call m::foo()
so that when an entity from a module is used, its name can be prepended by the module name? If Fortran only had the unadorned use
without the only
qualifier or the option for renaming, I’d say that optional prepending with the module name would be a necessary feature. But given those capabilities, would the ability to prepend be redundant?