I found no prohibition and it works with three compilers, so I assume
it's OK to USE a MODULE, say, once directly and once indirectly (by
using another MODULE which uses the first one).
I think this is a good idea. For example, I might be doing some
numerical stuff USEing some module, and then later decide I need some
more stuff, and USE another module which (perhaps unknown to me) USEs
the first one. Fine---things work like I want and I guess there is no
ambiguity involved.
However, in the mental model if inserting the MODULE information at the
place of the USE statement, one could think that one would get a warning
saying that something has been multiply defined. Sure, the compiler
should be able to catch this and do things correctly and the ones I
tested (Digital, IBM, SUN) do, but can I DEPEND on this behaviour?!
In the books I consulted (Digital documentation, Michel, M&R) I couldn't
find any explicit permission of this (or, more, something saying that I
can count on it) in the obvious places. (The Digital documentation
describes the behaviour of two USE statements within one scoping unit,
and, combined with the information about host association it would seem
that my example above would be two USE statements in the same scoping
unit, and thus the behaviour should be as described and as my tests
show. However, USE is such an important concept that I would have
expected such information to be discussed where USE is discussed, since
perhaps the concept of host association by using a module which uses
another (as opposed to, say, internal procedures) is not immediately
obvious when thinking about USE.)
This is not a critique of the above-mentioned documentation; in fact, I
really like and highly recommend all three!
--
Phillip Helbig Email ... [log in to unmask]
Nuffield Radio Astronomy Laboratories Tel. ..... +44 1477 571 321 (ext. 297)
Jodrell Bank Fax ................. +44 1477 571 618
Macclesfield Telex ................. 36149 JODREL G
UK-Cheshire SK11 9DL Web .... http://www.jb.man.ac.uk/~pjh/
My opinions are not necessarily those of NRAL or the University of Manchester.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|