how to reference module variable without the use of USE, but explicit?



Suppose one have module:

---------- m.f90 ---------
module m
public
integer :: z;
end module m
--------------

and program that uses the above module:

---------- test_m.f90 ----------
program test_m
use m
implicit none
z = 5;
end
--------------------

The above works OK. But I'd rather be explicit in saying in which
module the variable z is in. So I wanted to write

-------------------
program test_m
implicit none

m%z = 5; (or m.z or something like that)

end
-------------------

But that does not work. This also do not work:

---------------------
program test_m
USE m
implicit none

m%z = 5;

end
---------------------

I know, wrong syntax. It thinks 'm' is variable.

I want have the association to the module name be there,
where I can see it, and not global.

Because if one has 10 modules being USE'D, then one can more easily
see in the code which variable belongs to which module if the
module name can be part of the variable name.

Looked at many examples, but they all just do the global USE
and then in the code, just use whatever that module exports.

Any idea what is the right syntax to do what I want?

For example, in Ada, I can write m.z=5; where m is a
package name, same as Fortran module.

thanks,
--Nasser
.



Relevant Pages

  • Re: Attack a sacred Python Cow
    ... Prove that implicit self is a good ... You're suggesting a change to Python's syntax. ... .cat = cat # assumes that the Object With No Name has foo ...
    (comp.lang.python)
  • Re: syntax philosophy
    ... > I'm checking out Python as a candidate for replacing Perl as my "Swiss ... The longer I can remember the syntax for performing ... of the implicit object creation semantics that go with it. ... The problem with such implicit semantics is that they increase the ...
    (comp.lang.python)
  • Re: Introducing the "it" keyword
    ... Implicit variables make me queasy. ... change to Ruby moves it closer to language X ... our problems in ways that bring Ruby closer to Y. ... The fact that Lisp's macros blend in with the language syntax is very nice on one hand because it allows to define "new syntax" easily and make certain constructs look familiar. ...
    (comp.lang.ruby)
  • Re: Principle of Orthogonal Design
    ... Different authors use different syntax. ... subset of the implicit free variables. ... Furthermore the syntax could support binding or renaming of free ...
    (comp.databases.theory)
  • Re: I really hate .NET especially inside Delphi
    ... Nick Hodges (Borland/DTG) wrote: ... Why does it have to be implicit? ... In a grid the CM is updated as are any controls bound to the same CM. ... Because ADO.NET has the same - your quibbling over syntax while ...
    (borland.public.delphi.non-technical)