!topic LSN on Operator Visibility in Ada 9X !key LSN-1035 on Operator Visibility in Ada 9X !reference MS-8.4;4.6 !from Bob Duff $Date: 92/10/08 16:46:27 $ $Revision: 1.3 $ !discussion This Language Study Note discusses operator visibility via the use_type_clause. We have dropped the (automatic) primitive visibility proposal from the language. Instead, the user may request something similar to primitive visibility via the use_type_clause. The syntax is: use_clause ::= use_package_clause | use_type_clause; use_package_clause ::= ... -- as for use_clause in Ada 83 use_type_clause ::= use type type_mark {, type_mark}; Thus, a use_type_clause may be used anywhere a use_clause is legal: as a declarative_item, or in a context_clause. A use_type_clause of the form "use type T;", makes all primitive operators of the type containing T directly visible (except in the naming conflict cases, which are handled in the same way as in Ada 83). Although MS;4.6 does not make it clear, we have decided to allow use_type_clauses in context_clauses. This requires changing RM83-10.1.1(3), "The only names allowed in a use clause of a context clause are the simple names of library packages mentioned by previous with clauses of the context clause." Instead, those library units will be the only visible library units, but one will be able to "use P.X;" or "use type P.X;" where X is a package or subtype nested within library unit P. We consider this functionality (use_type_clauses in context_clauses) to be important for the user, and relatively easy to implement. We expect one style to be: with P1; use P1.T1; with P2; use P2.T2; package body Q is ... where the types declared in each with-ed package are named by use_type_clauses right up front. Forcing the use_type_clauses to be moved down into the body would be an annoyance to users, and if Q were a subprogram, it would be strange not to allow the use_type_clause to apply to the formal_part.