[net.lang.ada] Preferred Style of use clause

harbaughs@eglin-vax (08/02/86)

From:	HARBAUGHS     2-AUG-1986 08:55
To:	MAILER!BAKIN@MIT-MULTICS,HARBAUGHS   
Subj:	preferred style of use clause

My preference is None of the Above. I prefer
with This; use This;
with That; use That;
-- Vertical space is precious on my tiny 24 line screen and I
--hate to waste it when all that horizontal space is unused.
regards, sam harbaugh
---------------------
------

jsweet@ICS.UCI.EDU (Jerry Sweet) (08/03/86)

I think David Bakin really meant to ask about the semantic difference
between the two "use" clause placements, rather than the textual
appearance.  If I understand "with" and "use" clauses correctly, the
"use" clause applies only within the given lexical scope.  If it is
placed before the compilation unit, the identifiers introduced by the
"with" clause may be used without dot notation throughout the entire
compilation unit, including the formal parameters, if any.  If the
"use" clause is placed inside the compilation unit, then any formal
parameter types introduced by the context clause have to employ dot
notation.

Example 1:

with foo;
procedure bar(x: foo.zot) is...

Example 2:

with foo; use foo;
procedure bar(x: zot) is...


-jns