On Tuesday, July 22, 2003, at 11:10 AM, [log in to unmask]
wrote:
> USE is a means of sharing information. If a procedure USEs a
> module,
> that tells the procedure that there are variables, data types, and
> procedures
> of with certain names over in that module that the procedure migh
> reference.
>
> The thing in this discussion missing for me is not the USE of a
> module, but the design of modules intended to be USEd. A module
> supplies some functionality, implements a contract, provides an API.
> In order to do that, a module may have to have a variety of "internal"
> pieces of data and procedures. This is what PUBLIC/PRIVATE helps
> with, and it is important for modules intended for general use to be
> diligent abut using PUBLIC/PRIVATE. If that were done, I suspect
> there would be less use of ONLY; why gain access only part of an API?
> ... (trimmed)
For me, a slavish use of ONLY on every USE statement is a form of
self-documentation. When a name arises wiithin a scoping unit,
whether variable or procedure, that is not declared locally or in an
argument list, and there are half a dozen USE statements at the top,
ONLY tells you where the name was defined. To me, it's just an
extension of the self-discipline imposed by IMPLICIT NONE, even though
it's introduced for entirely different purposes. Not for everyone, I'm
sure.
Brian Hanson
Environmental Science, U.of.Delaware
[log in to unmask]
|