My practice is to collect all the module USE statements in the
header. That way I can see the accessible external environment at a
glance. All the procedures inherit this environment. Occasionally I
have thought it would be useful to limit the extent of this
inheritance by an (optional) ACCEPT statement at the top of each
procedure, possibly along these lines:
ACCEPT ALL (the default) would give access to everything
in the module header (external environment + global
variables etc)
ACCEPT NONE would completely isolate the procedure
(except for its arguments and its own specific
USE statements)
ACCEPT, ONLY : a,b.. would reference specific items in
the module header.
For my purposes in each procedure I would probably do
ACCEPT NONE
ACCEPT, ONLY : a,b...
What do people think of this?
Roger Young.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|