1"use strict";(self.webpackChunkada_lang_io=self.webpackChunkada_lang_io||[]).push([["3228"],{23513(e,i,n){n.r(i),n.d(i,{metadata:()=>r,default:()=>p,frontMatter:()=>h,contentTitle:()=>A,toc:()=>j,assets:()=>x});var r=JSON.parse('{"id":"arm/AA-10/AA-10.1","title":"10.1. Separate Compilation","description":"This Reference Manual output has not been verified,","source":"@site/docs/arm/AA-10/AA-10.1.mdx","sourceDirName":"arm/AA-10","slug":"/arm/AA-10/AA-10.1","permalink":"/docs/arm/AA-10/AA-10.1","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":86,"frontMatter":{"sidebar_position":86},"sidebar":"referenceManualSidebar","previous":{"title":"10. Program Structure and Compilation Issues","permalink":"/docs/arm/AA-10/"},"next":{"title":"10.2. Program Execution","permalink":"/docs/arm/AA-10/AA-10.2"}}'),s=n(74848),a=n(28453),t=n(98113),d=n(60271),c=n(9011),l=n(48554),o=n(94029);let h={sidebar_position:86},A="10.1. Separate Compilation",x={},j=[{value:"Implementation Permissions",id:"implementation-permissions",level:4},{value:"Wording Changes from Ada 83",id:"wording-changes-from-ada-83",level:4},{value:"10.1.1 Compilation Units - Library Units",id:"1011--compilation-units---library-units",level:2},{value:"Syntax",id:"syntax",level:4},{value:"Legality Rules",id:"legality-rules",level:4},{value:"Static Semantics",id:"static-semantics",level:4},{value:"Dynamic Semantics",id:"dynamic-semantics",level:4},{value:"Examples",id:"examples",level:4},{value:"Extensions to Ada 83",id:"extensions-to-ada-83",level:4},{value:"Wording Changes from Ada 83",id:"wording-changes-from-ada-83-1",level:4},{value:"Extensions to Ada 95",id:"extensions-to-ada-95",level:4},{value:"Wording Changes from Ada 95",id:"wording-changes-from-ada-95",level:4},{value:"Wording Changes from Ada 2005",id:"wording-changes-from-ada-2005",level:4},{value:"10.1.2 Context Clauses - With Clauses",id:"1012--context-clauses---with-clauses",level:2},{value:"Language Design Principles",id:"language-design-principles",level:4},{value:"Syntax",id:"syntax-1",level:4},{value:"Name Resolution Rules",id:"name-resolution-rules",level:4},{value:"Legality Rules",id:"legality-rules-1",level:4},{value:"Examples",id:"examples-1",level:4},{value:"Extensions to Ada 83",id:"extensions-to-ada-83-1",level:4},{value:"Wording Changes from Ada 83",id:"wording-changes-from-ada-83-2",level:4},{value:"Incompatibilities With Ada 95",id:"incompatibilities-with-ada-95",level:4},{value:"Extensions to Ada 95",id:"extensions-to-ada-95-1",level:4},{value:"Incompatibilities With Ada 2005",id:"incompatibilities-with-ada-2005",level:4},{value:"Wording Changes from Ada 2005",id:"wording-changes-from-ada-2005-1",level:4},{value:"Wording Changes from Ada 2012",id:"wording-changes-from-ada-2012",level:4},{value:"10.1.3 Subunits of Compilation Units",id:"1013--subunits-of-compilation-units",level:2},{value:"Syntax",id:"syntax-2",level:4},{value:"Legality Rules",id:"legality-rules-2",level:4},{value:"Post-Compilation Rules",id:"post-compilation-rules",level:4},{value:"Examples",id:"examples-2",level:4},{value:"Extensions to Ada 83",id:"extensions-to-ada-83-2",level:4},{value:"Extensions to Ada 95",id:"extensions-to-ada-95-2",level:4},{value:"Wording Changes from Ada 95",id:"wording-changes-from-ada-95-1",level:4},{value:"Extensions to Ada 2005",id:"extensions-to-ada-2005",level:4},{value:"10.1.4 The Compilation Process",id:"1014--the-compilation-process",level:2},{value:"Name Resolution Rules",id:"name-resolution-rules-1",level:4},{value:"Legality Rules",id:"legality-rules-3",level:4},{value:"Implementation Permissions",id:"implementation-permissions-1",level:4},{value:"Extensions to Ada 83",id:"extensions-to-ada-83-3",level:4},{value:"Wording Changes from Ada 95",id:"wording-changes-from-ada-95-2",level:4},{value:"10.1.5 Pragmas and Program Units",id:"1015--pragmas-and-program-units",level:2},{value:"Post-Compilation Rules",id:"post-compilation-rules-1",level:4},{value:"Implementation Permissions",id:"implementation-permissions-2",level:4},{value:"Wording Changes from Ada 95",id:"wording-changes-from-ada-95-3",level:4},{value:"Wording Changes from Ada 2005",id:"wording-changes-from-ada-2005-2",level:4},{value:"Wording Changes from Ada 2012",id:"wording-changes-from-ada-2012-1",level:4},{value:"10.1.6 Environment-Level Visibility Rules",id:"1016--environment-level-visibility-rules",level:2},{value:"Static Semantics",id:"static-semantics-1",level:4},{value:"Wording Changes from Ada 83",id:"wording-changes-from-ada-83-3",level:4},{value:"Wording Changes from Ada 95",id:"wording-changes-from-ada-95-4",level:4}];function m(e){let i={a:"a",admonition:"admonition",h1:"h1",h2:"h2",h4:"h4",header:"header",p:"p",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.header,{children:(0,s.jsx)(i.h1,{id:"101-separate-compilation",children:"10.1. Separate Compilation"})}),"\n",(0,s.jsx)(i.admonition,{type:"danger",children:(0,s.jsxs)(i.p,{children:["This Reference Manual output has not been verified,\nand may contain omissions or errors.\nReport any problems on the ",(0,s.jsx)(i.a,{href:"https://github.com/ada-lang-io/ada-lang-io/issues/20",children:"tracking issue"})]})}),"\n","\n",(0,s.jsx)(l.A,{children:"1"}),"\n",(0,s.jsxs)("p",{children:["[ A ",(0,s.jsx)("i",{children:"program unit"})," is either a package, a task unit, a protected unit, a protected entry, a generic unit, or an explicitly declared subprogram other than an enumeration literal. Certain kinds of program units can be separately compiled. Alternatively, they can a
1ppear physically nested within other program units. ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"1.a/5"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{children:"Term entry: "}),(0,s.jsx)("b",{children:"program unit"})," \u2014 language construct that is a package, a task unit, a protected unit, a protected entry, a generic unit, or an explicitly declared subprogram other than an enumeration literal",(0,s.jsx)("br",{}),"Note: Certain kinds of program units can be separately compiled. Alternatively, they can appear physically nested within other program units.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"2"}),"\n",(0,s.jsxs)("p",{children:["The text of a program can be submitted to the compiler in one or more ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0285",children:"compilation"})}),"s. Each ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0285",children:"compilation"})})," is a succession of ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0286",children:"compilation_unit"})}),"s. A ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0286",children:"compilation_unit"})})," contains either the declaration, the body, or a renaming of a program unit.] The representation for a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0285",children:"compilation"})})," is implementation-defined. ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"2.a"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"implementation-defined",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"The representation for a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0285",children:"compilation"})}),".",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"2.b"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"ramification",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"Some implementations might choose to make a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0285",children:"compilation"})})," be a source (text) file. Others might allow multiple source files to be automatically concatenated to form a single ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0285",children:"compilation"})}),". Others still may represent the source in a nontextual form such as a parse tree. Note that the RM95 does not even define the concept of a source file.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"2.c"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Note that a protected subprogram is a subprogram, and therefore a program unit. An instance of a generic unit is a program unit.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"2.d"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["A protected entry is a program unit, but protected entries cannot be separately compiled. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"2.e/5"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{children:"Term entry: "}),(0,s.jsx)("b",{children:"compilation unit"})," \u2014 program unit that is separately compiled",(0,s.jsx)("br",{}),(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0286",children:"compilation_unit"})})," contains either the declaration, the body, or a renaming of a program unit.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"3"}),"\n",(0,s.jsxs)("p",{children:["A library unit is a separately compiled program unit, and is a package, subprogram, or generic unit. Library units may have other (logically nested) library units as children, and may have other program units physically nested within them. A root library unit, together with its children and grandchildren and so on, form a ",(0,s.jsx)("i",{children:"subsystem"}),". ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"3.a/5"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{children:"Term entry: "}),(0,s.jsx)("b",{children:"library unit"})," \u2014 separately compiled program unit, which is a package, a subprogram, or a generic unit",(0,s.jsx)("br",{}),"Note: Library units can have other (logically nested) library units as children, and can have other program units physically nested within them. A root library unit, together with its children and grandchildren and s
1o on, form a subsystem.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(i.h4,{id:"implementation-permissions",children:"Implementation Permissions"}),"\n",(0,s.jsx)(l.A,{children:"4"}),"\n",(0,s.jsxs)("p",{children:["An implementation may impose implementation-defined restrictions on ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0285",children:"compilation"})}),"s that contain multiple ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0286",children:"compilation_unit"})}),"s. ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"4.a"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"implementation-defined",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"Any restrictions on ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0285",children:"compilation"})}),"s that contain multiple ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0286",children:"compilation_unit"})}),"s.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"4.b"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"discussion",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"For example, an implementation might disallow a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0285",children:"compilation"})})," that contains two versions of the same compilation unit, or that contains the declarations for library packages P1 and P2, where P1 precedes P2 in the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0285",children:"compilation"})})," but P1 has a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," that mentions P2. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(d.A,{children:(0,s.jsx)(i.h4,{id:"wording-changes-from-ada-83",children:"Wording Changes from Ada 83"})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"4.c"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["The interactions between language issues and environmental issues are left open in Ada 95. The environment concept is new. In Ada 83, the concept of the program library, for example, appeared to be quite concrete, although the rules had no force, since implementations could get around them simply by defining various mappings from the concept of an Ada program library to whatever data structures were actually stored in support of separate compilation. Indeed, implementations were encouraged to do so.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"4.d"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["In RM83, it was unclear which was the official definition of \u201Cprogram unit\u201D. Definitions appeared in RM83-5, 6, 7, and 9, but not 12. Placing it here seems logical, since a program unit is sort of a potential compilation unit. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)("a",{id:"Subclause_10.1.1"}),"\n",(0,s.jsx)(i.h2,{id:"1011--compilation-units---library-units",children:"10.1.1 Compilation Units - Library Units"}),"\n",(0,s.jsx)(l.A,{children:"1_10.1.1"}),"\n",(0,s.jsxs)("p",{children:["[A ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," is a compilation unit that is the declaration, body, or renaming of a library unit. Each library unit (except Standard) has a ",(0,s.jsx)("i",{children:"parent unit"}),", which is a library package or generic library package.] A library unit is a ",(0,s.jsx)("i",{children:"child"})," of its parent unit. The ",(0,s.jsx)("i",{children:"root"})," library units are the children of the predefined library package Standard. ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"1.a_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"ramification",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"Standard is a library unit. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(i.h4,{id:"syntax",children:"Syntax"}),"\n",(0,s.jsx)(l.A,{children:"2_10.1.1"}),"\n",(0,s.jsxs)(c.A,{children:[(0,s.jsx)("code",{children:"compilation"}),(0,s.jsx)("a",{id:"S0285"}),(0,s.jsx)("code",{children:" ::= "}),"{",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0286",children:"compilation_unit"})}),"}",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(l.A,{children:"3_10.1.1"}),"\n",(0,s.jsx)(c.A,{children:(0,s.jsxs)(i.p,{children:[(0,s.jsxs)("code",{children:["compilation","_","unit"]}),(0,s.jsx)("a",{id:"S0286"}),(0,s.jsx)("code",{children:" ::= "}),(0,s.jsx)("br",{})," ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})})," ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})}),(0,s.jsx)("br",{})," | ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})})," ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0302",children:"subunit"})}),(0,s.jsx)("br",{})]})}),"\n",(0,s.jsx)(l.A,{children:"4_10.1.1"}),"\n",(0,s.jsx)(c.A,{children:(0,s.jsxs)(i.p,{children:[(0,s.jsxs)("code",{children:["library","_","item"]}),(0,s.jsx)("a",{id:"S0287"}),(0,s.jsx)("code",{children:" ::= "}),"[",(0,s.jsx)("b",{children:"private"}),"] ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0288",children:"library_unit_declaration"})}),(0,s.jsx)("br",{})," | ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0290",children:"library_unit_body"})}),(0,s.jsx)("br",{})," | [",(0,s.jsx)("b",{children:"private"}),"] ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0289",children:"library_unit_renaming_declaration"})}),(0,s.jsx)("br",{})]})}),"\n",(0,s.jsx)(l.A,{children:"5_10.1.1"}),"\n",(0,s.jsx)(c.A,{children:(0,s.jsxs)(i.p,{children:[(0,s.jsxs)("code",{children:["library","_","unit","_","declaration"]}),(0,s.jsx)("a",{id:"S0288"}),(0,s.jsx)("code",{children:" ::= "}),(0,s.jsx)("br",{})," ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.1#S0195",children:"subprogram_declaration"})})," | ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-7/AA-7.1#S0229",children:"package_declaration"})}),(0,s.jsx)("br",{})," | ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-12/AA-12.1#S0310",children:"generic_declaration"})})," | ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-12/AA-12.3#S0315",children:"generic_instantiation"})}),(0,s.jsx)("br",{})]})}
1),"\n",(0,s.jsx)(l.A,{children:"6_10.1.1"}),"\n",(0,s.jsx)(c.A,{children:(0,s.jsxs)(i.p,{children:[(0,s.jsxs)("code",{children:["library","_","unit","_","renaming","_","declaration"]}),(0,s.jsx)("a",{id:"S0289"}),(0,s.jsx)("code",{children:" ::= "}),(0,s.jsx)("br",{})," ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.5#S0241",children:"package_renaming_declaration"})}),(0,s.jsx)("br",{})," | ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.5#S0243",children:"generic_renaming_declaration"})}),(0,s.jsx)("br",{})," | ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.5#S0242",children:"subprogram_renaming_declaration"})}),(0,s.jsx)("br",{})]})}),"\n",(0,s.jsx)(l.A,{children:"7_10.1.1"}),"\n",(0,s.jsx)(c.A,{children:(0,s.jsxs)(i.p,{children:[(0,s.jsxs)("code",{children:["library","_","unit","_","body"]}),(0,s.jsx)("a",{id:"S0290"}),(0,s.jsx)("code",{children:" ::= "}),(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.3#S0216",children:"subprogram_body"})})," | ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-7/AA-7.2#S0231",children:"package_body"})}),(0,s.jsx)("br",{})]})}),"\n",(0,s.jsx)(l.A,{children:"8_10.1.1"}),"\n",(0,s.jsxs)(c.A,{children:[(0,s.jsxs)("code",{children:["parent","_","unit","_","name"]}),(0,s.jsx)("a",{id:"S0291"}),(0,s.jsx)("code",{children:" ::= "}),(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-4/AA-4.1#S0091",children:"name"})}),(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(l.A,{children:"8.1/2_10.1.1"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00397-01"]}),"\n",(0,s.jsxs)("p",{class:"Indented2",children:["An ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.3#S0234",children:"overriding_indicator"})})," is not allowed in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.1#S0195",children:"subprogram_declaration"})}),", ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-12/AA-12.3#S0315",children:"generic_instantiation"})}),", or ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.5#S0242",children:"subprogram_renaming_declaration"})})," that declares a library unit.",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"8.a.1/2_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"reason",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"All of the listed items syntactically include ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.3#S0234",children:"overriding_indicator"})}),", but a library unit can never override anything. A majority of the ARG thought that allowing ",(0,s.jsx)("b",{children:"not overriding"})," in that case would be confusing instead of helpful. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"9_10.1.1"}),"\n",(0,s.jsxs)("p",{children:["A ",(0,s.jsx)("i",{children:"library unit"})," is a program unit that is declared by a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})}),". When a program unit is a library unit, the prefix \u201Clibrary\u201D is used to refer to it (or \u201Cgeneric library\u201D if generic), as well as to its declaration and body, as in \u201Clibrary procedure\u201D, \u201Clibrary ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-7/AA-7.2#S0231",children:"package_body"})}),"\u201D, or \u201Cgeneric library package\u201D. The term ",(0,s.jsx)("i",{children:"compilation unit"})," is used to refer to a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0286",children:"compilation_unit"})}),". When the meaning is clear from context, the term is also used to refer to the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0286",children:"compilation_unit"})})," or to the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.11#S0090",children:"proper_body"})})," of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0302",children:"subunit"})})," [(that is, the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0286",children:"compilation_unit"})})," without the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})})," and the ",(0,s.jsx)("b",{children:"separate"})," (",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0291",children:"parent_unit_name"})}),"))]. ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"9.a_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"discussion",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"In this example: ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"9.b_10.1.1"}),(0,s.jsx)(c.A,{language:"ada",children:(0,s.jsxs)(i.p,{children:["with Ada.Text","_","IO;","\n","package P is","\n"," ...","\n","end P;","\n"]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"9.c_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["the term \u201Ccompilation unit\u201D can refer to this text: \u201C",(0,s.jsx)("b",{children:"with"})," Ada.Text","_","IO; ",(0,s.jsx)("b",{children:"package"})," P ",(0,s.jsx)("b",{children:"is"})," ... ",(0,s.jsx)("b",{children:"end"})," P;\u201D or to this text: \u201C",(0,s.jsx)("b",{children:"package"})," P ",(0,s.jsx)("b",{children:"is"})," ... ",(0,s.jsx)("b",{children:"end"})," P;
1\u201D. We use this shorthand because it corresponds to common usage.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"9.d_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["We like to use the word \u201Cunit\u201D for declaration-plus-body things, and \u201Citem\u201D for declaration or body separately (as in ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.11#S0087",children:"declarative_item"})}),"). The terms \u201C",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0286",children:"compilation_unit"})}),"\u201D, \u201Ccompilation unit\u201D, and \u201C",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0302",children:"subunit"})}),"\u201D are exceptions to this rule. We considered changing \u201C",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0286",children:"compilation_unit"})}),"\u201D, \u201Ccompilation unit\u201D to \u201C",(0,s.jsxs)("code",{children:["compilation","_","item"]}),"\u201D, \u201Ccompilation item\u201D, respectively, but we decided not to. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"10_10.1.1"}),"\n",(0,s.jsxs)("p",{children:["The ",(0,s.jsx)("i",{children:"parent declaration"})," of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," (and of the library unit) is the declaration denoted by the ",(0,s.jsx)("code",{children:(0,s.jsxs)("a",{href:"/docs/arm/AA-10/AA-10.1#S0291",children:["parent","_","unit","_","name"]})}),", if any, of the ",(0,s.jsx)("code",{children:(0,s.jsxs)("a",{href:"/docs/arm/AA-6/AA-6.1#S0201",children:["defining","_","program","_","unit","_","name"]})})," of the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})}),". If there is no ",(0,s.jsx)("code",{children:(0,s.jsxs)("a",{href:"/docs/arm/AA-10/AA-10.1#S0291",children:["parent","_","unit","_","name"]})}),", the parent declaration is the declaration of Standard, the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," is a ",(0,s.jsx)("i",{children:"root"})," ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})}),", and the library unit (renaming) is a ",(0,s.jsx)("i",{children:"root"})," library unit (renaming). The declaration and body of Standard itself have no parent declaration. The ",(0,s.jsx)("i",{children:"parent unit"})," of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," or library unit is the library unit declared by its parent declaration. ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"10.a_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"discussion",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"The declaration and body of Standard are presumed to exist from the beginning of time, as it were. There is no way to actually write them, since there is no syntactic way to indicate lack of a parent. An attempt to compile a package Standard would result in Standard.Standard. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"10.b_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"reason",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"Library units (other than Standard) have \u201Cparent declarations\u201D and \u201Cparent units\u201D. Subunits have \u201Cparent bodies\u201D. We didn't bother to define the other possibilities: parent body of a library unit, parent declaration of a subunit, parent unit of a subunit. These are not needed, and might get in the way of a correct definition of \u201Cchild\u201D. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"11_10.1.1"}),"\n",(0,s.jsxs)("p",{children:["[The children of a library unit occur immediately within the declarative region of the declaration of the library unit.] The ",(0,s.jsx)("i",{children:"ancestors"})," of a library unit are itself, its parent, its parent's parent, and so on. [(Standard is an ancestor of every library unit.)] The ",(0,s.jsx)("i",{children:"descendant"})," relation is the inverse of the ancestor relation. ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"11.a_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"reason",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"These definitions are worded carefully to avoid defining subunits as children. Only library units can be children.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"11.b_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["We use the unadorned term \u201Cancestors\u201D here to concisely define both \u201Cancestor unit\u201D and \u201Cancestor declaration\u201D. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"12_10.1.1"}),"\n",(0,s.jsxs)("p",{children:["A ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0288",children:"library_unit_declaration"})})," or a ",(0,s.jsx)("code",{children:(0,s.jsxs)("a",{href:"/docs/arm/AA-10/AA-10.1#S0289",children:["library","_","unit","_","renaming","_","declaration"]})})," is ",(0,s.jsx)("i",{children:"private"})," if the declaration is immediately preceded by the reserved word ",(0,s.jsx)("b",{children:"private"}),"; it is otherwise ",(0,s.jsx)("i",{children:"public"}),". A library unit is private or public according to its declaration. The ",(0,s.jsx)("i",{children:"public de
1scendants"})," of a library unit are the library unit itself, and the public descendants of its public children. Its other descendants are ",(0,s.jsx)("i",{children:"private descendants"}),". ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"12.a_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"discussion",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"The first concept defined here is that a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," is either public or private (not in relation to anything else \u2014 it's just a property of the library unit). The second concept is that a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," is a public descendant or private descendant ",(0,s.jsx)("i",{children:"of a given ancestor"}),". A given ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," can be a public descendant of one of its ancestors, but a private descendant of some other ancestor.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"12.b_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["A subprogram declared by a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.3#S0216",children:"subprogram_body"})})," (as opposed to a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.1#S0195",children:"subprogram_declaration"})}),") is always public, since the syntax rules disallow the reserved word ",(0,s.jsx)("b",{children:"private"})," on a body.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"12.c_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Note that a private library unit is a ",(0,s.jsx)("i",{children:"public"})," descendant of itself, but a ",(0,s.jsx)("i",{children:"private"})," descendant of its parent. This is because it is visible outside itself \u2014 its privateness means that it is not visible outside its parent.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"12.d_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Private children of Standard are legal, and follow the normal rules. It is intended that implementations might have some method for taking an existing environment, and treating it as a package to be \u201Cimported\u201D into another environment, treating children of Standard in the imported environment as children of the imported package. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"12.e_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"ramification",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"Suppose we have a public library unit A, a private library unit A.B, and a public library unit A.B.C. A.B.C is a public descendant of itself and of A.B, but a private descendant of A; since A.B is private to A, we don't allow A.B.C to escape outside A either. This is similar to the situation that would occur with physical nesting, like this: ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"12.f_10.1.1"}),(0,s.jsx)(c.A,{language:"ada",children:(0,s.jsxs)(i.p,{children:["package A is","\n","private","\n"," package B is","\n"," package C is","\n"," end C;","\n"," private","\n"," end B;","\n","end A;","\n"]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"12.g_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Here, A.B.C is visible outside itself and outside A.B, but not outside A. (Note that this example is intended to illustrate the visibility of program units from the outside; the visibility within child units is not quite identical to that of physically nested units, since child units are nested after their parent's declaration.) ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"12.1/2_10.1.1"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00217-06"]}),"\n",(0,s.jsxs)("p",{children:["For each library ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-7/AA-7.1#S0229",children:"package_declaration"})})," in the environment, there is an implicit declaration of a ",(0,s.jsx)("i",{children:"limited view"})," of that library package. The limited view of a package contains:",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(l.A,{children:"12.2/3_10.1.1"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00217-06","AI05-0129-1","AI05-0262-1"]}),"\n",(0,s.jsxs)("ul",{children:[(0,s.jsxs)("li",{children:["For each ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-7/AA-7.1#S0229",children:"package_declaration"})})," occurring immediately within the visible part, a declaration of the limited view of that package, with the same ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.1#S0201",children:"defining_program_unit_name"})}),".",(0,s.jsx)("br",{})]}),(0,s.jsx)(l.A,{children:"12.3/3_10.1.1"}),(0,s.jsx)(o.A,{items:["AI95-00217-06","AI95-00326-01","AI05-0108-1","AI05-0129-1","AI05-0262-1"]}),(0,s.jsxs)("li",{children:["For each ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.2#S0023",children:"type_declaration"})})," occurring immediately within the visible part that is not an ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.10#S0085",children:"incomplete_type_declaration"})}),", an incomplete view of the type with no ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.7#S0059",children:"discriminant_part"})}),"; if the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.2#S0023",children:"type_declaration"})})," is tagged, then the view is a tagged incomplete view. ",(0,s.jsx)("br",{})]})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"12.g.1/3_10.1.1"}),(0,s.jsx)(o.A,{items:["AI05-0108-1"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"reason",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"The incomplete view of a type does not have a discriminant","_","part even if the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.2#S0023",children:"type_declaration"})})," does have one. This is necessary because semantic analysis (and the associated dependence on ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),"s) would be necessary to determine the types of the discriminants.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"12.g.2/3_10.1.1"}),(0,s.jsx)(o.A,{items:["AI05-0129-1"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["No incomplete views of incomplete types are included in the limited view. The rules of ",(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.10#Subclause_3.10.1",children:"3.10.1"})," ensure that the completion of any visible incomplete type is declared in the same visible part, so such an incomplete view w
1ould simply be redundant. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"12.g.3/2_10.1.1"}),(0,s.jsx)(o.A,{items:["AI95-00217-06"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"discussion",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"The implementation model of a limited view is that it can be determined solely from the syntax of the source of the unit, without any semantic analysis. That allows it to be created without the semantic dependences of a full unit, which is necessary for it to break mutual dependences of units. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"12.g.4/2_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"ramification",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"The limited view does not include package instances and their contents. Semantic analysis of a unit (and dependence on its ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),"s) would be needed to determine the contents of an instance. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"12.4/2_10.1.1"}),"\n",(0,s.jsxs)("p",{children:["The limited view of a library ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-7/AA-7.1#S0229",children:"package_declaration"})})," is private if that library ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-7/AA-7.1#S0229",children:"package_declaration"})})," is immediately preceded by the reserved word ",(0,s.jsx)("b",{children:"private"}),".",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(l.A,{children:"12.5/2_10.1.1"}),"\n",(0,s.jsxs)("p",{children:["[There is no syntax for declaring limited views of packages, because they are always implicit.] The implicit declaration of a limited view of a library package [is not the declaration of a library unit (the library ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-7/AA-7.1#S0229",children:"package_declaration"})})," is); nonetheless, it] is a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})}),". The implicit declaration of the limited view of a library package forms an (implicit) compilation unit whose ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})})," is empty.",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(l.A,{children:"12.6/2_10.1.1"}),"\n",(0,s.jsxs)("p",{children:["A library ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-7/AA-7.1#S0229",children:"package_declaration"})})," is the completion of the declaration of its limited view.",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"12.h/2_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{children:"To be honest: "}),"This is notwithstanding the rule in ",(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.11#Subclause_3.11.1",children:"3.11.1"})," that says that implicit declarations don't have completions. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"12.i/2_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"reason",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"This rule explains where to find the completions of the incomplete views defined by the limited view. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(i.h4,{id:"legality-rules",children:"Legality Rules"}),"\n",(0,s.jsx)(l.A,{children:"13_10.1.1"}),"\n",(0,s.jsxs)("p",{children:["The parent unit of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," shall be a [library] package or generic [library] package.",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(l.A,{children:"14_10.1.1"}),"\n",(0,s.jsxs)("p",{children:["If a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.1#S0201",children:"defining_program_unit_name"})})," of a given declaration or body has a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0291",children:"parent_unit_name"})}),", then the given declaration or body shall be a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})}),". The body of a program unit shall be a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," if and only if the declaration of the program unit is a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})}),". In a ",(0,s.jsx)("code",{children:(0,s.jsxs)("a",{href:"/docs/arm/AA-10/AA-10.1#S0289",children:["library","_","unit","_","renaming","_","declaration"]})}),", the [(old)] ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-4/AA-4.1#S0091",children:"name"})})," shall denote a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})}),". ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"14.a_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"discussion",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"We could have allowed nested program units to be children of other program units; their semantics would make sense. We disallow them to keep things simpler and because they wouldn't be particularly useful. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"15/2_10.1.1"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00217-06"]}),"\n",(0,s.jsxs)("p",{children:["A ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0291",children:"parent_unit_name"})})," [(which can be used within a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.1#S0201",children:"defining_program_unit_name"})})," of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," and in the ",(0,s.jsx)("b",{children:"separate"})," clause of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0302",children:"subunit"})}),")], and each of its ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-4/AA-4.1#S0093",children:"prefix"})}),"es, shall not denote a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.5#S0238",children:"renaming_declaration"})}),". [On the other hand, a name that denotes a ",(0,s.jsx)("code",{children:(0,s.jsxs)("a",{href:"/docs/arm/AA-10/AA-10.1#S0289",children:["library","_","unit","_","renaming","_","declaration"]})})," is allowed in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0296",children:"nonlimited_with_clause"})})," and other places where the name of a library unit is allowed.]",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(l.A,{children:"16_10.1.1"}),"\n",(0,s.jsxs)("p",{children:["If a library package is an instance of a generic package, then every child of the library package shall either be itself an instance or be a renaming of a library unit. ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"16.a_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"discussion",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"A child of an instance of a given generic unit will often be an instance of a (generic) child of the given generic unit. This is not required, however. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"16.b_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"reason",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"Instances are forbidden from having noninstance children for two reasons: ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"16.c_10.1.1"}),(0,s.jsxs)("dt",{children:[(0,s.jsx)("br",{}),"1."]}),(0,s.jsxs)("dl",{children:[(0,s.jsxs)("dd",{children:['We want all source code that can depend on information from the private part of a library unit to be inside the "subsystem" rooted at the library unit. If an instance of a generic unit were allowed to have a noninstance as a child, the source code of that child might depend on information from the private part of the generic unit, even though it is outside the subsystem rooted at the generic unit.',(0,s.jsx)("br",{})]}),(0,s.jsx)(l.A,{children:"16.d_10.1.1"}),(0,s.jsxs)("dt",{children:[(0,s.jsx)("br",{}),"2."]}),(0,s.jsxs)("dd",{children:["Disallowing noninstance children simplifies the description of the semantics of children of generic packages. ",(0,s.jsx)("br",{})]})]})]}),"\n",(0,s.jsx)(l.A,{children:"17/3_10.1.1"}),"\n",(0,s.jsx)(o.A,{items:["AI05-0004-1"]}),"\n",(0,s.jsxs)("p",{children:["A child of a generic library package shall either be itself a generic unit or be a renaming of some other child of the same generic unit.",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(l.A,{children:"18_10.1.1"}),"\n",(0,s.jsxs)("p",{children:["A child of a parent generic package shall be instantiated or renamed only within the declarative region of the parent generic.",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(l.A,{children:"19/2_10.1.1"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00331-01"]}),"\n",(0,s.jsxs)("p",{children:["For each child ",(0,s.jsx)("i",{children:"C"})," of some parent generic package ",(0,s.jsx)("i",{children:"P"}),", there is a corresponding declaration ",(0,s.jsx)("i",{children:"C"})," nested immediately within each instance of ",(0,s.jsx)("i",{children:"P"}),". For the purposes of this rule, if a child ",(0,s.jsx)("i",{children:"C"})," itself has a child ",(0,s.jsx)("i",{children:"D"}),", each corresponding declaration for ",(0,s.jsx)("i",{children:"C"})," has a corresponding child ",(0,s.jsx)("i",{children:"D"}),". [The corresponding declaration for a child within an instance is visible only within the scope of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," that mentions the (original) child generic unit.]",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"19.a_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"implementation-note",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"Within the child, like anything nested in a generic unit, one can make up-level references to the current instance of its parent, and thereby gain access to the formal parameters of the parent, to the types declared in the parent, etc. This \u201Cnesting\u201D model applies even within the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-12/AA-12.1#S0313",children:"generic_formal_part"})})," of the child, as it does for a generic child of a nongeneric unit. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"19.b_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"ramification",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"Suppose P is a generic library package, and P.C is a generic child of P. P.C can be instantiated inside the declarative region of P. Outside P, P.C can be mentioned only in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),". Conceptually, an instance I of P is a package that has a nested generic unit called I.C. Mentioning P.C in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," allows I.C to be instantiated. I need not be a library unit, and the instantiation of I.C need not be a library unit. If I is a library unit, and an instance of I.C is a child of I, then this instance has to be called something other than C.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"20_10.1.1"}),"\n",(0,s.jsxs)("p",{children:["A library subprogram shall not override a primitive subprogram. ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"20.a_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"reason",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"This prevents certain obscure anomalies. For example, if a library subprogram were to override a subprogram declared in its parent package, then in a compilation unit that depends ",(0,s.jsx)("i",{children:"in"}),"directly on the library subprogram, the library subprogram could hide the overridden operation from all visibility, but the library subprogram itself would not be visible.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"20.b_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Note that even without this rule, such subprograms would be illegal for tagged types, because of the freezing rules. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"21_10.1.1"}),"\n",(0,s.jsxs)("p",{children:["The defining name of a function that is a compilation unit shall not be an ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.1#S0202",children:"operator_symbol"})}),". ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"21.a_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"reason",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"Since overloading is not permitted among compilation units, it seems unlikely that it would be useful to define one as an operator. Note that a subunit could be renamed within its parent to be an operator. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(i.h4,{id:"static-semantics",children:"Static Semantics"}),"\n",(0,s.jsx)(l.A,{children:"22_10.1.1"}),"\n",(0,s.jsxs)("p",{children:["A ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.5#S0242",children:"subprogram_renaming_declaration"})})," that is a ",(0,s.jsx)("code",{children:(0,s.jsxs)("a",{href:"/docs/arm/AA-10/AA-10.1#S0289",children:["library","_","unit","_","renaming","_","declaration"]})})," is a renaming-as-declaration, not a renaming-as-body.",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(l.A,{children:"23_10.1.1"}),"\n",(0,s.jsxs)("p",{children:["[There are two kinds of dependences among compilation units:] ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(l.A,{children:"24/5_10.1.1"}),"\n",(0,s.jsx)(o.A,{items:["AI12-0445-1"]}),"\n",(0,s.jsxs)("ul",{children:[(0,s.jsxs)("li",{children:["[The ",(0,s.jsx)("i",{children:"semantic dependences"})," (see below) are the ones necessary to check the compile-time rules across compilation unit boundaries; a compilation unit depends semantically on the other compilation units necessary to determine its legality. The visibility rules are based on the semantic dependences.",(0,s.jsx)("br",{})]}),(0,s.jsx)(l.A,{children:"25_10.1.1"}),(0,s.jsxs)("li",{children:["The ",(0,s.jsx)("i",{children:"elaboration dependences"})," (see ",(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.2",children:"10.2"}),") determine the order of elaboration of ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})}),"s.] ",(0,s.jsx)("br",{})]})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"25.a_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"discussion",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"Don't confuse these kinds of dependences with the run-time dependences among tasks and masters defined in ",(0,s.jsx)("a",{href:"/docs/arm/AA-9/AA-9.3",children:"9.3"}),", \u201C",(0,s.jsx)("a",{href:"/docs/arm/AA-9/AA-9.3",children:"Task Depen
1dence - Termination of Tasks"}),"\u201D. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"26/2_10.1.1"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00217-06"]}),"\n",(0,s.jsxs)("p",{children:["A ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," depends semantically upon its parent declaration. A subunit depends semantically upon its parent body. A ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0290",children:"library_unit_body"})})," depends semantically upon the corresponding ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0288",children:"library_unit_declaration"})}),", if any. The declaration of the limited view of a library package depends semantically upon the declaration of the limited view of its parent. The declaration of a library package depends semantically upon the declaration of its limited view. A compilation unit depends semantically upon each ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," mentioned in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," of the compilation unit. In addition, if a given compilation unit contains an ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-4/AA-4.1#S0100",children:"attribute_reference"})})," of a type defined in another compilation unit, then the given compilation unit depends semantically upon the other compilation unit. The semantic dependence relationship is transitive.",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"26.a_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"discussion",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"The \u201Cif any\u201D in the third sentence is necessary because library subprograms are not required to have a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.1#S0195",children:"subprogram_declaration"})}),". ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"26.b_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{children:"To be honest: "}),"If a given compilation unit contains a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-11/AA-11.2#S0306",children:"choice_parameter_specification"})}),", then the given compilation unit depends semantically upon the declaration of Ada.Exceptions.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"26.c_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["If a given compilation unit contains a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-2/AA-2.8#S0019",children:"pragma"})})," with an argument of a type defined in another compilation unit, then the given compilation unit depends semantically upon the other compilation unit. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"26.d_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"discussion",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"For example, a compilation unit containing X'Address depends semantically upon the declaration of package System.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"26.e_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["For the Address attribute, this fixes a hole in Ada 83. Note that in almost all cases, the dependence will need to exist due to ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),"s, even without this rule. Hence, the rule has very little effect on programmers.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"26.f_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Note that the semantic dependence does not have the same effect as a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),"; in order to denote a declaration in one of those packages, a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," will generally be needed.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"26.g_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Note that no special rule is needed for an ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-13/AA-13.3#S0349",children:"attribute_definition_clause"})}),", since an expression after ",(0,s.jsx)("b",{children:"use"})," will require semantic dependence upon the compilation unit containing the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.2#S0023",children:"type_declaration"})})," of interest.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"26.h/2_10.1.1"}),(0,s.jsx)(o.A,{items:["AI95-00217-06"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Unlike a full view of a package, a limited view does not depend semantically on units mentioned in ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),"s of the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0286",children:"compilation_unit"})})," that defines the package. Formally, this is achieved by saying that the limited view has an empty ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})}),". This is necessary so that they can be useful for their intended purpose: allowing mutual dependences between packages. The lack of semantic dependence limits the contents of a limited view to the items that can be determined solely from the syntax of the source of the package, without any semantic analysis. That allows it to be created without the semantic dependences of a full package. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(i.h4,{id:"dynamic-semantics",children:"Dynamic Semantics"}),"\n",(0,s.jsx)(l.A,{children:"26.1/2_10.1.1"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00217-06"]}),"\n",(0,s.jsxs)("p",{children:["The elaboration of the declaration of the limited view of a package has no effect. ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"27/5_10.1.1"}),(0,s.jsx)(o.A,{items:["AI12-0442-1"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["NOTE 1 A simple program can consist of a single compilation unit. A ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0285",children:"compilation"})})," can have no compilation units; for example, its text can consist of ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-2/AA-2.8#S0019",children:"pragma"})}),"s. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"27.a_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"ramification",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"Such ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-2/AA-2.8#S0019",children:"pragma"})}),"s cannot have any arguments that are ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-4/AA-4.1#S0091",children:"name"})}),"s, by a previous rule of this subclause. A ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0285",children:"compilation"})})," can even be entirely empty, which is probably not useful.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"27.b_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Some interesting properties of the three kinds of dependence: The elaboration dependences also include the semantic dependences, except that subunits are taken together with their parents. The semantic dependences partly determine the order in which the compilation units appear in the environment at compile time. At run time, the order is partly determined by the elaboration dependences.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"27.c_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["The model whereby a child is inside its parent's declarative region, after the parent's declaration, as explained in ",(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.1",children:"8.1"}
1),", has the following ramifications: ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"27.d_10.1.1"}),(0,s.jsxs)("ul",{children:[(0,s.jsxs)("li",{children:["The restrictions on \u201Cearly\u201D use of a private type (RM83-7.4.1(4)) or a deferred constant (RM83-7.4.3(2)) do not apply to uses in child units, because they follow the full declaration.",(0,s.jsx)("br",{})]}),(0,s.jsx)(l.A,{children:"27.e_10.1.1"}),(0,s.jsxs)("li",{children:["A library subprogram is never primitive, even if its profile includes a type declared immediately within the parent's ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-7/AA-7.1#S0230",children:"package_specification"})}),", because the child is not declared immediately within the same ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-7/AA-7.1#S0230",children:"package_specification"})})," as the type (so it doesn't declare a new primitive subprogram), and because the child is forbidden from overriding an old primitive subprogram. It is immediately within the same declarative region, but not the same ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-7/AA-7.1#S0230",children:"package_specification"})}),". Thus, for a tagged type, it is not possible to call a child subprogram in a dispatching manner. (This is also forbidden by the freezing rules.) Similarly, it is not possible for the user to declare primitive subprograms of the types declared in the declaration of Standard, such as Integer (even if the rules were changed to allow a library unit whose name is an operator symbol).",(0,s.jsx)("br",{})]}),(0,s.jsx)(l.A,{children:"27.f_10.1.1"}),(0,s.jsxs)("li",{children:["When the parent unit is \u201Cused\u201D the simple names of the with'd child units are directly visible (see ",(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.4",children:"8.4"}),", \u201C",(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.4",children:"Use Clauses"}),"\u201D).",(0,s.jsx)("br",{})]}),(0,s.jsx)(l.A,{children:"27.g_10.1.1"}),(0,s.jsxs)("li",{children:["When a parent body with's its own child, the defining name of the child is directly visible, and the parent body is not allowed to include a declaration of a homograph of the child unit immediately within the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.11#S0086",children:"declarative_part"})})," of the body (RM83-8.3(17)). ",(0,s.jsx)("br",{})]})]})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"27.h_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Note that \u201Cdeclaration of a library unit\u201D is different from \u201C",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0288",children:"library_unit_declaration"})}),"\u201D \u2014 the former includes ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.3#S0216",children:"subprogram_body"})}),". Also, we sometimes really mean \u201Cdeclaration of a view of a library unit\u201D, which includes ",(0,s.jsx)("code",{children:(0,s.jsxs)("a",{href:"/docs/arm/AA-10/AA-10.1#S0289",children:["library","_","unit","_","renaming","_","declaration"]})}),"s.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"27.i_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["The visibility rules generally imply that the renamed view of a ",(0,s.jsx)("code",{children:(0,s.jsxs)("a",{href:"/docs/arm/AA-10/AA-10.1#S0289",children:["library","_","unit","_","renaming","_","declaration"]})})," has to be mentioned in a ",(0,s.jsx)("code",{children:(0,s.jsxs)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:["with","_","clause"]})})," of the ",(0,s.jsx)("code",{children:(0,s.jsxs)("a",{href:"/docs/arm/AA-10/AA-10.1#S0289",children:["library","_","unit","_","renaming","_","declaration"]})}),". ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"27.j_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{children:"To be honest: "}),"The real rule is that the renamed library unit has to be visible in the ",(0,s.jsx)("code",{children:(0,s.jsxs)("a",{href:"/docs/arm/AA-10/AA-10.1#S0289",children:["library","_","unit","_","renaming","_","declaration"]})}),". ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"27.k_10.
11.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"reason",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"In most cases, \u201Chas to be visible\u201D means there has to be a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),". However, it is possible in obscure cases to avoid the need for a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),"; in particular, a compilation unit such as \u201C",(0,s.jsx)("b",{children:"package"})," P.Q ",(0,s.jsx)("b",{children:"renames"})," P;\u201D is legal with no ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),"s (though not particularly interesting). ASCII is physically nested in Standard, and so is not a library unit, and cannot be renamed as a library unit. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"28_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["NOTE 2 The ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.1#S0199",children:"designator"})})," of a library function cannot be an ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.1#S0202",children:"operator_symbol"})}),", but a nonlibrary ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.5#S0238",children:"renaming_declaration"})})," is allowed to rename a library function as an operator. Within a partition, two library subprograms are required to have distinct names and hence cannot overload each other. However, ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.5#S0238",children:"renaming_declaration"})}),"s are allowed to define overloaded names for such subprograms, and a locally declared subprogram is allowed to overload a library subprogram. The expanded name Standard.L can be used to denote a root library unit L (unless the declaration of Standard is hidden) since root library unit declarations occur immediately within the declarative region of package Standard. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(i.h4,{id:"examples",children:"Examples"}),"\n",(0,s.jsx)(l.A,{children:"29_10.1.1"}),"\n",(0,s.jsxs)("p",{children:[(0,s.jsx)("i",{children:"Examples of library units:"})," ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(l.A,{children:"30_10.1.1"}),"\n",(0,s.jsx)(c.A,{language:"ada",children:(0,s.jsxs)(i.p,{children:["package Rational","_","Numbers.IO is -- public child of Rational","_","Numbers, see ",(0,s.jsx)("a",{href:"/docs/arm/AA-7/AA-7.1",children:"7.1"}),"\n"," procedure Put(R : in Rational);","\n"," procedure Get(R : out Rational);","\n","end Rational","_","Numbers.IO;","\n","\n",(0,s.jsx)(l.A,{children:"31_10.1.1"}),"\nprivate procedure Rational","_","Numbers.Reduce(R : in out Rational);","\n"," -- private child of Rational","_","Numbers","\n","\n",(0,s.jsx)(l.A,{children:"32_10.1.1"}),"\nwith Rational","_","Numbers.Reduce; -- refer to a private child","\n","package body Rational","_","Numbers is","\n"," ...","\n","end Rational","_","Numbers;","\n","\n",(0,s.jsx)(l.A,{children:"33_10.1.1"}),"\nwith Rational","_","Numbers.IO; use Rational","_","Numbers;","\n","with Ada.Text","_","io; -- see ",(0,s.jsx)("a",{href:"/docs/arm/AA-A/AA-A.10",children:"A.10"}),"\n","procedure Main is -- a root library procedure","\n"," R : Rational;","\n","begin","\n"," R := 5/3; -- construct a rational number, see ",(0,s.jsx)("a",{href:"/docs/arm/AA-7/AA-7.1",children:"7.1"}),"\n"," Ada.Text","_",'IO.Put("The answer is: ");',"\n"," IO.Put(R);","\n"," Ada.Text","_","IO.New","_","Line;","\n","end Main;","\n","\n",(0,s.jsx)(l.A,{children:"34_10.1.1"}),"\nwith Rational","_","Numbers.IO;","\n","package Rational","_","IO renames Rational","_","Numbers.IO;","\n"," -- a library unit renaming declaration","\n"]})}),"\n",(0,s.jsx)(l.A,{children:"35_10.1.1"}),"\n",(0,s.jsxs)("p",{children:["Each of the above ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})}),"s can be submitted to the compiler separately. ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"35.a_10.1.1"}),(0,s.jsxs)(t.A,{type:"aarm",aarm:"discussion",children:[(0,s.jsx)("b",{}),(0,s.jsx)("i",{children:"Example of a generic package with children:"}),(0,s.jsx)("br",{})]})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"35.b_10.1.1"}),(0,s.jsx)(c.A,{language:"ada",children:(0,s.jsxs)(i.p,{children:["generic","\n"," type Element is private;","\n"," with function Image(E : Element) return String;","\n","package Generic","_","Bags is","\n"," type Bag is limited private; -- A bag of Elements.","\n"," procedure Add(B : in out Bag; E : Element);","\n"," function Bag","_","Image(B : Bag) return String;","\n","private","\n"," type Bag is ...;","\n","end Generic","_","Bags;","\n","\n",(0,s.jsx)(l.A,{children:"35.c_10.1.1"}),"\ngeneric","\n","package Generic","_","Bags.Generic","_","Iterators is","\n"," ... -- various additional operations on Bags.","\n","\n",(0,s.jsx)(l.A,{children:"35.d_10.1.1"}),"\ngeneric","\n"," with procedure Use","_","Element(E : in Element);","\n"," -- Called once per bag element.","\n"," procedure Iterate(B : in Bag);","\n","end Generic","_","Bags.Generic","_","Iterators;","\n"]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"35.e_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["A package that instantiates the above generic units: ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"35.f_10.1.1"}),(0,s.jsx)(c.A,{language:"ada",children:(0,s.jsxs)(i.p,{children:["with Generic","_","Bags;","\n","with Generic","_","Bags.Generic","_","Iterators;","\n","package My","_","Abstraction is","\n"," type My","_","Type is ...;","\n"," function Image(X : My","_","Type) return String;","\n"," package Bags","_","Of","_","My","_","Type is new Generic","_","Bags(My","_","Type, Image);","\n"," package Iterators","_","Of","_","Bags","_","Of","_","My","_","Type is new Bags","_","Of","_","My","_","Type.Generic","_","Iterators;","\n","end My","_","Abstraction;","\n"]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"35.g_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["In the above example, Bags","_","Of","_","My","_","Type has a nested generic unit called Generic","_","Iterators. The second ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," makes that nested unit visible.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"35.h_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Here we show how the generic body could depend on one of its own children: ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"35.i_10.1.1"}),(0,s.jsx)(c.A,{language:"ada",children:(0,s.jsxs)(i.p,{children:["with Generic","_","Bags.Generic","_","Iterators;","\n","package body Generic","_","Bags is","\n"," procedure Add(B : in out Bag; E : Element) is ... end Add;","\n","\n",(0,s.jsx)(l.A,{children:"35.j_10.1.1"}),"\npackage Iters is new Generic","_","Iterators;","\n","\n",(0,s.jsx)(l.A,{children:"35.k_10.1.1"}),"\nfunction Bag","_","Image(B : Bag) return String is","\n"," Buffer : String(1..10","_","000);","\n"," Last : Integer := 0;","\n","\n",(0,s.jsx)(l.A,{children:"35.l_10.1.1"}),"\nprocedure Append","_","Image(E : in Element) is","\n"," Im : constant String := Image(E);","\n"," begin","\n"," if Last /= 0 then -- Insert a comma.","\n"," Last := Last + 1;","\n"," Buffer(Last) := ',';","\n"," end if;","\n"," Buffer(Last+1 .. Last+Im'Length) := Im;","\n"," Last := Last + Im'Length;","\n"," end Append","_","Image;","\n","\n",(0,s.jsx)(l.A,{children:"35.m_10.1.1"}),"\nprocedure Append","_","All is new Iters.Iterate(Append","_","Image);","\n"," begin","\n"," Append","_","All(B);","\n"," return Buffer(1..Last);","\n"," end Bag","_","Image;","\n","end Generic","_","Bags;","\n"]})})]}),"\n",(0,s.jsx)(d.A,{children:(0,s.jsx)(i.h4,{id:"extensions-to-ada-83",children:"Extensions to Ada 83"})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"35.n_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["The syntax rule for ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," is modified to allow the reserved word ",(0,s.jsx)("b",{children:"private"})," before a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0288",children:"library_unit_declaration"})}),".",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"35.o_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Children (other than children of Standard) are new in Ada 95.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"35.p_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Library unit renaming is new in Ada 95. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(d.A,{children:(0,s.jsx)(i.h4,{id:"wording-changes-from-ada-83-1",children:"Wording Changes from Ada 83"})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"35.q_10.1.1"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Standard is considered a library unit in Ada 95. This simplifies the descriptions, since it implies that the parent of each library unit is a library unit. (Standard itself has no parent, of course.) As in Ada 83, the language does not define any way to recompile Standard, since the name given in the declaration of a library unit is always interpreted in relation to Standard. That is, an attempt to compile a package Standard would result in Standard.Standard. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(d.A,{children:(0,s.jsx)(i.h4,{id:"extensions-to-ada-95",children:"Extensions to Ada 95"})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"35.r/2_10.1.1"}),(0,s.jsx)(o.A,{items:["AI95-00217-06"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["The concept of a limited view is new. Combined with ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0295",children:"limited_with_clause"})}),"s (see ",(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#Subclause_10.1.2",children:"10.1.2"}),"), they facilitate construction of mutually recursive types in multiple packages. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(d.A,{children:(0,s.jsx)(i.h4,{id:"wording-changes-from-ada-95",children:"Wording Changes from Ada 95"})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"35.s/2_10.1.1"}),(0,s.jsx)(o.A,{items:["AI95-00331-01"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Clarified the wording so that a grandchild generic unit will work as expected. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(d.A,{children:(0,s.jsx)(i.h4,{id:"wording-changes-from-ada-2005",children:"Wording Changes from Ada 2005"})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"35.t/3_10.1.1"}),(0,s.jsx)(o.A,{items:["AI05-0108-1","AI05-0129-1"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"correction",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{})," Clarified the wording so that it is clear that limited views of types never have discriminants and never are of incomplete types. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)("a",{id:"Subclause_10.1.2"}),"\n",(0,s.jsx)(i.h2,{id:"1012--context-clauses---with-clauses",children:"10.1.2 Context Clauses - With Clauses"}),"\n",(0,s.jsx)(l.A,{children:"1_10.1.2"}),"\n",(0,s.jsxs)("p",{children:["[A ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})})," is used to specify the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})}),"s whose names are needed within a compilation unit.] ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(i.h4,{id:"language-design-principles",children:"Language Design Principles"}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"1.a_10.1.2"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["The reader should be able to understand a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})})," without looking ahead. Similarly, when compiling a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})}),", the compiler should not have to look ahead at subsequent ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0293",children:"context_item"})}),"s, nor at the compilation unit to which the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})})," is attached. (We have not completely achieved this.)",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"1.b/2_10.1.2"}),(0,s.jsx)(o.A,{items:["AI95-00217-06"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["A ",(0,s.jsx)("i",{children:"ripple effect"})," occurs when the legality of a compilation unit could be affected by adding or removing an otherwise unneeded ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," on some compilation unit on which the unit depends, directly or indirectly. We try to avoid ripple effects because they make understanding and maintenance more difficult. However, ripple effects can occur because of direct visibility (as in child units); this seems impossible to eliminate. The ripple effect for ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),"s is somewhat similar to the Beaujolais effect (see ",(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.4",children:"8.4"}),") for ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.4#S0235",children:"use_clause"})}),"s, which we also try to avoid. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(i.h4,{id:"syntax-1",children:"Syntax"}),"\n",(0,s.jsx)(l.A,{children:"2_10.1.2"}),"\n",(0,s.jsxs)(c.A,{children:[(0,s.jsxs)("code",{children:["context","_","clause"]}),(0,s.jsx)("a",{id:"S0292"}),(0,s.jsx)("code",{children:" ::= "}),"{",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0293",children:"context_item"})}),"}",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(l.A,{children:"3_10.1.2"}),"\n",(0,s.jsx)(c.A,{children:(0,s.jsxs)(i.p,{children:[(0,s.jsxs)("code",{children:["context","_","item"]}),(0,s.jsx)("a",{id:"S0293"}),(0,s.jsx)("code",{children:" ::= "}),(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," | ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.4#S0235",children:"use_clause"})}),(0,s.jsx)("br",{})]})}),"\n",(0,s.jsx)(l.A,{children:"4/2_10.1.2"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00217-06","AI95-00262-01"]}),"\n",(0,s.jsx)(c.A,{children:(0,s.jsxs)(i.p,{children:[(0,s.jsxs)("code",{children:["with","_","clause"]}),(0,s.jsx)("a",{id:"S0294"}),(0,s.jsx)("code",{children:" ::= "}),(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0295",children:"limited_with_clause"})})," | ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0296",children:"nonlimited_with_clause"})}),(0,s.jsx)("br",{})]})}),"\n",(0,s.jsx)(l.A,{children:"4.1/2_10.1.2"}),"\n",(0,s.jsx)(c.A,{children:(0,s.jsxs)(i.p,{children:[(0,s.jsxs)("code",{children:["limited","_","with","_","clause"]}),(0,s.jsx)("a",{id:"S0295"}),(0,s.jsx)("code",{children:" ::= "}),(0,s.jsx)("b",{children:"limited"})," [",(0,s.jsx)("b",{children:"private"}),"] ",(0,s.jsx)("b",{children:"with"})," ",(0,s.jsxs)("i",{children:["library","_","unit","_"]}),(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-4/AA-4.1#S0091",c
1hildren:"name"})})," ","{",", ",(0,s.jsxs)("i",{children:["library","_","unit","_"]}),(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-4/AA-4.1#S0091",children:"name"})}),"}",";",(0,s.jsx)("br",{})]})}),"\n",(0,s.jsx)(l.A,{children:"4.2/2_10.1.2"}),"\n",(0,s.jsx)(c.A,{children:(0,s.jsxs)(i.p,{children:[(0,s.jsxs)("code",{children:["nonlimited","_","with","_","clause"]}),(0,s.jsx)("a",{id:"S0296"}),(0,s.jsx)("code",{children:" ::= "}),"[",(0,s.jsx)("b",{children:"private"}),"] ",(0,s.jsx)("b",{children:"with"})," ",(0,s.jsxs)("i",{children:["library","_","unit","_"]}),(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-4/AA-4.1#S0091",children:"name"})})," ","{",", ",(0,s.jsxs)("i",{children:["library","_","unit","_"]}),(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-4/AA-4.1#S0091",children:"name"})}),"}",";",(0,s.jsx)("br",{})]})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"4.a/2_10.1.2"}),(0,s.jsx)(o.A,{items:["AI95-00217-06"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"discussion",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"A ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0295",children:"limited_with_clause"})})," makes a limited view of a unit visible.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"4.b/2_10.1.2"}),(0,s.jsx)(o.A,{items:["AI95-00262-01"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["A ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," containing the reserved word ",(0,s.jsx)("b",{children:"private"})," is called a ",(0,s.jsxs)("i",{children:["private with","_","clause"]}),". It can be thought of as making items visible only in the private part, although it really makes items visible everywhere except the visible part. It can be used both for documentation purposes (to say that a unit is not used in the visible part), and to allow access to private units that otherwise would be prohibited. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(i.h4,{id:"name-resolution-rules",children:"Name Resolution Rules"}),"\n",(0,s.jsx)(l.A,{children:"5_10.1.2"}),"\n",(0,s.jsxs)("p",{children:["The ",(0,s.jsx)("i",{children:"scope"})," of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," that appears on a ",(0,s.jsx)("code",{children:(0,s.jsxs)("a",{href:"/docs/arm/AA-10/AA-10.1#S0288",children:["library","_","unit","_","declaration"]})})," or ",(0,s.jsx)("code",{children:(0,s.jsxs)("a",{href:"/docs/arm/AA-10/AA-10.1#S0289",children:["library","_","unit","_","renaming","_","declaration"]})})," consists of the entire declarative region of the declaration[, which includes all children and subunits]. The scope of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," that appears on a body consists of the body[, which includes all subunits]. ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"5.a/2_10.1.2"}),(0,s.jsx)(o.A,{items:["AI95-00262-01"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"discussion",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"Suppose a nonprivate ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," of a public library unit mentions one of its private siblings. (This is only allowed on the body of the public library unit.) We considered making the scope of that ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," not include the visible part of the public library unit. (This would only matter for a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.3#S0216",children:"subprogram_body"})}),", since those are the only kinds of body that have a visible part, and only if the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.3#S0216",children:"subprogram_body"})})," completes a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.1#S0195",children:"subprogram_declaration"})}),", since otherwise the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," would be illegal.) We did not put in such a rule for two reasons: (1) It would complicate the wording of the rules, because we would have to split each ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," into pieces, in order to correctly handle \u201C",(0,s.jsx)("b",{children:"with"})," P, Q;\u201D where P is public and Q is private. (2) The conformance rules prevent any problems. It doesn't matter if a type name in the spec of the body denotes the completion of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-7/AA-7.3#S0232",children:"private_type_declaration"})}),".",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"5.b_10.1.2"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["A ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," also affects visibility within subsequent ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.4#S0235",children:"use_clause"})}),"s and ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-2/AA-2.8#S0019",children:"pragma"})}),"s of the same ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})}),", even though those are not in the scope of the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),". ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"6/2_10.1.2"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00217-06"]}),"\n",(0,s.jsxs)("p",{children:["A ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," (and the corresponding library unit) is ",(0,s.jsx)("i",{children:"named"})," in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," if it is denoted by a ",(0,s.jsxs)("i",{children:["library","_","unit","_"]}),(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-4/AA-4.1#S0091",children:"name"})})," in the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),". A ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," (and the corresponding library unit) is ",(0,s.jsx)("i",{children:"mentioned"})," in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," if it is named in the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," or if it is denoted by a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-4/AA-4.1#S0093",children:"prefix"})})," in the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),".",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"6.a_10.1.2"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"discussion",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"With_clause"})}),"s control the visibility of declarations or renamings of library units. Mentioning a root library unit in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," makes its declaration directly visible. Mentioning a nonroot library unit makes its declaration visible. See Clause ",(0,s.jsx)("a",{href:"/docs/arm/AA-8/",children:"8"})," for details.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"6.b/2_10.1.2"}),(0,s.jsx)(o.A,{items:["AI95-00114-01"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Note that this rule implies that \u201C",(0,s.jsx)("b",{children:"with"})," A.B.C;\u201D is almost equivalent to \u201C",(0,s.jsx)("b",{children:"with"})," A, A.B, A.B.C;\u201D. The reason for making a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," apply to all the ancestor units is to avoid \u201Cvisibility holes\u201D \u2014 situations in which an inner program unit is visible while an outer one is not. Visibility holes would cause semantic complexity and implementation difficulty. (This is not exactly equivalent because the latter ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," names A and A.B, while the previous one does not. Whether a unit is \u201Cnamed\u201D does not have any effect on visibility, however, so it is equivalent for visibility purposes.)",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"7_10.1.2"}),"\n",(0,s.jsxs)("p",{children:["[Outside its own declarative region, the declaration or renaming of a library unit can be visible only within the scope of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," that mentions it. The visibility of the declaration or renaming of a library unit otherwise follows from its placement in the environment.] ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(i.h4,{id:"legality-rules-1",children:"Legality Rules"}),"\n",(0,s.jsx)(l.A,{children:"8/2_10.1.2"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00262-01"]}),"\n",(0,s.jsxs)("p",{children:["If a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," of a given ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0286",children:"compilation_unit"})})," mentions a private child of some library unit, then the given ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0286",children:"compilation_unit"})})," shall be one of: ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(l.A,{children:"9/2_10.1.2"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00262-01"]}),"\n",(0,s.jsxs)("ul",{children:[(0,s.jsxs)("li",{children:["the declaration, body, or subunit of a private descendant of that library unit;",(0,s.jsx)("br",{})]}),(0,s.jsx)(l.A,{children:"10/2_10.1.2"}),(0,s.jsx)(o.A,{items:["AI95-00220-01","AI95-00262-01"]}),(0,s.jsxs)("li",{children:["the body or subunit of a public de
1scendant of that library unit, but not a subprogram body acting as a subprogram declaration (see ",(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#Subclause_10.1.4",children:"10.1.4"}),"); or",(0,s.jsx)("br",{})]}),(0,s.jsx)(l.A,{children:"11/2_10.1.2"}),(0,s.jsx)(o.A,{items:["AI95-00262-01"]}),(0,s.jsxs)("li",{children:["the declaration of a public descendant of that library unit, in which case the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," shall include the reserved word ",(0,s.jsx)("b",{children:"private"}),". ",(0,s.jsx)("br",{})]})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"11.a/2_10.1.2"}),(0,s.jsx)(o.A,{items:["AI95-00262-01"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"reason",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"The purpose of this rule is to prevent a private child from being visible from outside the subsystem rooted at its parent. A private child can be semantically depended-on without violating this principle if it is used in a private ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),". ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"11.b_10.1.2"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"discussion",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"This rule violates the one-pass ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})}),"s Language Design Principle. We rationalize this by saying that at least that Language Design Principle works for legal compilation units.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"11.c_10.1.2"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Example: ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"11.d_10.1.2"}),(0,s.jsx)(c.A,{language:"ada",children:(0,s.jsxs)(i.p,{children:["package A is","\n","end A;","\n","\n",(0,s.jsx)(l.A,{children:"11.e_10.1.2"}),"\npackage A.B is","\n","end A.B;","\n","\n",(0,s.jsx)(l.A,{children:"11.f_10.1.2"}),"\nprivate package A.B.C is","\n","end A.B.C;","\n","\n",(0,s.jsx)(l.A,{children:"11.g_10.1.2"}),"\npackage A.B.C.D is","\n","end A.B.C.D;","\n","\n",(0,s.jsx)(l.A,{children:"11.h_10.1.2"}),"\nwith A.B.C; -- (1)","\n","private package A.B.X is","\n","end A.B.X;","\n","\n",(0,s.jsx)(l.A,{children:"11.i_10.1.2"}),"\npackage A.B.Y is","\n","end A.B.Y;","\n","\n",(0,s.jsx)(l.A,{children:"11.j_10.1.2"}),"\nwith A.B.C; -- (2)","\n","package body A.B.Y is","\n","end A.B.Y;","\n","\n",(0,s.jsx)(l.A,{children:"11.j.1/2_10.1.2"}),"\nprivate with A.B.C; -- (3)","\n","package A.B.Z is","\n","end A.B.Z;","\n"]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"11.k/2_10.1.2"}),(0,s.jsx)(o.A,{items:["AI95-00262-01"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["(1) is OK because it's a private child of A.B \u2014 it would be illegal if we made A.B.X a public child of A.B. (2) is OK because it's the body of a child of A.B. (3) is OK because it's a child of A.B, and it is a private ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),". It would be illegal to say \u201C",(0,s.jsx)("b",{children:"with"})," A.B.C;\u201D on any ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," whose name does not start with \u201CA.B\u201D. Note that mentioning A.B.C.D in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," automatically mentions A.B.C as well, so \u201C",(0,s.jsx)("b",{children:"with"})," A.B.C.D;\u201D is illegal in the same places as \u201C",(0,s.jsx)("b",{children:"with"})," A.B.C;\u201D. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"12/5_10.1.2"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00262-01","AI05-0005-1","AI05-0077-1","AI05-0122-1","AI12-0261-1"]}),"\n",(0,s.jsxs)("p",{children:["A ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-4/AA-4.1#S0091",children:"name"})})," denoting a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," (or the corresponding declaration for a child of a generic within an instance \u2014 see ",(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#Subclause_10.1.1",children:"10.1.1"}),"), if it is visible only due to being mentioned in one or more ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),"s of a unit ",(0,s.jsx)("i",{children:"U"})," that include the reserved word ",(0,s.jsx)("b",{children:"private"}),", shall appear only within: ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(l.A,{children:"13/2_10.1.2"}),"\n",(0,s.jsxs)("ul",{children:[(0,s.jsxs)("li",{children:["a private part;",(0,s.jsx)("br",{})]}),(0,s.jsx)(l.A,{children:"14/5_10.1.2"}),(0,s.jsx)(o.A,{items:["AI12-0261-1"]}
1),(0,s.jsxs)("li",{children:["a body of a public descendant of ",(0,s.jsx)("i",{children:"U"}),", but not within the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.1#S0196",children:"subprogram_specification"})})," of a body of a subprogram that is a public descendant of ",(0,s.jsx)("i",{children:"U"}),";",(0,s.jsx)("br",{})]}),(0,s.jsx)(l.A,{children:"15/5_10.1.2"}),(0,s.jsx)(o.A,{items:["AI12-0261-1"]}),(0,s.jsxs)("li",{children:["a private descendant of ",(0,s.jsx)("i",{children:"U"})," or its body; or",(0,s.jsx)("br",{})]}),(0,s.jsx)(l.A,{children:"16/2_10.1.2"}),(0,s.jsxs)("li",{children:["a pragma within a context clause. ",(0,s.jsx)("br",{})]})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"16.a/2_10.1.2"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"ramification",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"These rules apply only if all of the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),"s that mention the name include the reserved word ",(0,s.jsx)("b",{children:"private"}),". They do not apply if the name is mentioned in any ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," that does not include ",(0,s.jsx)("b",{children:"private"}),". ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"16.b/3_10.1.2"}),(0,s.jsx)(o.A,{items:["AI05-0077-1"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"reason",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"These rules make the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," visible anywhere that is not visible outside the subsystem rooted at the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0286",children:"compilation_unit"})})," having the private ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),", including private parts of packages nested in the visible part, private parts of child packages, the visible part of private children, and context clause pragmas like Elaborate","_","All.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"16.c/2_10.1.2"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["We considered having the scope of a private ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," not include the visible part. However, that rule would mean that moving a declaration between the visible part and the private part could change its meaning from one legal interpretation to a different legal interpretation. For example: ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"16.d/2_10.1.2"}),(0,s.jsx)(c.A,{language:"ada",children:(0,s.jsxs)(i.p,{children:["package A is","\n"," function B return Integer;","\n","end A;","\n","\n",(0,s.jsx)(l.A,{children:"16.e/2_10.1.2"}),"\nfunction B return Integer;","\n","\n",(0,s.jsx)(l.A,{children:"16.f/2_10.1.2"}),"\nwith A;","\n","private with B;","\n","package C is","\n"," use A;","\n"," V1 : Integer := B; -- (1)","\n","private","\n"," V2 : Integer := B; -- (2)","\n","end C;","\n"]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"16.g/2_10.1.2"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["If we say that library subprogram B is not in scope in the visible part of C, then the B at (1) resolves to A.B, while (2) resolves to library unit B. Simply moving a declaration could silently change its meaning. With the legality rule defined above, the B at (1) is illegal. If the user really meant A.B, they still can say that. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"17/2_10.1.2"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00217-06"]}),"\n",(0,s.jsxs)("p",{children:["[A ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," mentioned in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0295",children:"limited_with_clause"})})," shall be the implicit declaration of the limited view of a library package, not the declaration of a subprogram, generic unit, generic instance, or a renaming.]",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"17.a/2_10.1.2"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"proof",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"This is redundant because only such implicit declarations are visible in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0295",children:"limited_with_clause"})}),". See ",(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#Subclause_10.1.6",children:"10.1.6"}),". ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"18/2_10.1.2"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00217-06","AI95-00412-01"]}),"\n",(0,s.jsxs)("p",{children:["A ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0295",children:"limited_with_clause"})})," shall not appear on a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0290",children:"library_unit_body"})}),", ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0302",children:"subunit"})}),", or ",(0,s.jsx)("code",{children:(0,s.jsxs)("a",{href:"/docs/arm/AA-10/AA-10.1#S0289",children:["library","_","unit","_","renaming","_","declaration"]})}),".",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"18.a/2_10.1.2"}),(0,s.jsx)(o.A,{items:["AI95-00412-01"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"reason",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"We don't allow a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0295",children:"limited_with_clause"})})," on a ",(0,s.jsx)("code",{children:(0,s.jsxs)("a",{href:"/docs/arm/AA-10/AA-10.1#S0289",children:["library","_","unit","_","renaming","_","declaration"]})})," because it would be useless and therefore probably is a mistake. A renaming cannot appear in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0295",children:"limited_with_clause"})})," (by the rule prior to this one), and a renaming of a limited view cannot appear in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0296",children:"nonlimited_with_clause"})})," (because the name would not be within the scope of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," denoting the package, see ",(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.5#Subclause_8.5.3",children:"8.5.3"}),"). Nor could it be the parent of another unit. That doesn't leave anywhere that the name of such a renaming ",(0,s.jsx)("b",{children:"could"})," appear, so we simply make writing it illegal. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"19/2_10.1.2"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00217-06"]}),"\n",(0,s.jsxs)("p",{children:["A ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0295",children:"limited_with_clause"})})," that names a library package shall not appear:",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(l.A,{children:"20/3_10.1.2"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00217-06","AI05-0040-1"]}),"\n",(0,s.jsx)("ul",{children:(0,s.jsxs)("li",{children:["in the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})})," for the explicit declaration of the named library package or any of its desce
1ndants;",(0,s.jsx)("br",{})]})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"20.a/2_10.1.2"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"reason",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"We have to explicitly disallow ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"20.b/2_10.1.2"}),(0,s.jsx)(c.A,{language:"ada",children:(0,s.jsxs)(i.p,{children:["limited with P;","\n","package P is ...","\n"]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"20.c/2_10.1.2"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["as we can't depend on the semantic dependence rules to do it for us as with regular withs. This says \u201Cnamed\u201D and not \u201Cmentioned\u201D in order that ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"20.d/2_10.1.2"}),(0,s.jsx)(c.A,{language:"ada",children:(0,s.jsxs)(i.p,{children:["limited private with P.Child;","\n","package P is ...","\n"]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"20.e/2_10.1.2"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["can be used to allow a mutual dependence between the private part of P and the private child P.Child, which occurs in interfacing and other problems. Since the child always semantically depends on the parent, this is the only way such a dependence can be broken.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"20.f/3_10.1.2"}),(0,s.jsx)(o.A,{items:["AI05-0040-1"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["The part about descendants catches examples like ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"20.g/3_10.1.2"}),(0,s.jsx)(c.A,{language:"ada",children:(0,s.jsxs)(i.p,{children:["limited with P;","\n","package P.Child is ...","\n"]})})]}),"\n",(0,s.jsx)(l.A,{children:"21/3_10.1.2"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00217-06","AI05-0077-1","AI05-0262-1"]}),"\n",(0,s.jsx)("ul",{children:(0,s.jsxs)("li",{children:["within a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})})," for a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," that is within the scope of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0296",children:"nonlimited_with_clause"})})," that mentions the same library package; or",(0,s.jsx)("br",{})]})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"21.a.1/3_10.1.2"}),(0,s.jsx)(o.A,{items:["AI05-0077-1"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"ramification",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"This applies to ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0296",children:"nonlimited_with_clause"})}),"s found in the same ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})}),", as well as ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0296",children:"nonlimited_with_clause"})}),"s found on parent units. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"21.a/3_10.1.2"}),(0,s.jsx)(o.A,{items:["AI05-0077-1"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"reason",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"Such a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0295",children:"limited_with_clause"})})," could have no effect, and would be confusing. If a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0296",children:"nonlimited_with_clause"})})," for the same package is inherited from a parent unit or given in the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})}),", the full view is available, which strictly provides more information than the limited view. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"22/3_10.1.2"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00217-06","AI05-0077-1","AI05-0262-1"]}),"\n",(0,s.jsx)("ul",{children:(0,s.jsxs)("li",{children:["within a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})})," for a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," that is within the scope of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.4#S0235",children:"use_clause"})})," that names an entity declared within the declarative region of the library package.",(0,s.jsx)("br",{})]})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"22.a.1/3_10.1.2"}),(0,s.jsx)(o.A,{items:["AI05-0077-1"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"ramification",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"This applies to ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.4#S0235",children:"use_clause"})}),"s found in the same ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})}),", as well as ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.4#S0235",children:"use_clause"})}),"s found in (or on) parent units. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"22.a/2_10.1.2"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"reason",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"This prevents visibility issues, where whether an entity is an incomplete or full view depen
1ds on how the name of the entity is written. The ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0295",children:"limited_with_clause"})})," cannot be useful, as we must have the full view available in the parent in order for the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.4#S0235",children:"use_clause"})})," to be legal. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"23/2_10.1.2"}),(0,s.jsx)(o.A,{items:["AI95-00217-06"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["NOTE A ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," mentioned in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0296",children:"nonlimited_with_clause"})})," of a compilation unit is visible within the compilation unit and hence acts just like an ordinary declaration. Thus, within a compilation unit that mentions its declaration, the name of a library package can be given in ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.4#S0235",children:"use_clause"})}),"s and can be used to form expanded names, a library subprogram can be called, and instances of a generic library unit can be declared. If a child of a parent generic package is mentioned in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0296",children:"nonlimited_with_clause"})}),", then the corresponding declaration nested within each visible instance is visible within the compilation unit. Similarly, a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," mentioned in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0295",children:"limited_with_clause"})})," of a compilation unit is visible within the compilation unit and thus can be used to form expanded names.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"23.a_10.1.2"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"ramification",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"The rules given for ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),"s are such that the same effect is obtained whether the name of a library unit is mentioned once or more than once by the applicable ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),"s, or even within a given ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),".",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"23.b_10.1.2"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["If a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," mentions a ",(0,s.jsx)("code",{children:(0,s.jsxs)("a",{href:"/docs/arm/AA-10/AA-10.1#S0289",children:["library","_","unit","_","renaming","_","declaration"]})}),", it only \u201Cmentions\u201D the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-4/AA-4.1#S0093",children:"prefix"})}),"es appearing explicitly in the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," (and the renamed view itself); the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," is not defined to mention the ancestors of the renamed entity. Thus, if X renames Y.Z, then \u201Cwith X;\u201D does not make the declarations of Y or Z visible. Note that this does not cause the dreaded visibility holes mentioned above. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(i.h4,{id:"examples-1",children:"Examples"}),"\n",(0,s.jsx)(l.A,{children:"24/5_10.1.2"}),"\n",(0,s.jsx)(o.A,{items:["AI12-0429-1"]}),"\n",(0,s.jsxs)("p",{children:[(0,s.jsx)("i",{children:"Examples of use of with clauses, limited with clauses, and private with clauses:"})," ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(l.A,{children:"25/2_10.1.2"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00433-01"]}),"\n",(0,s.jsxs)(c.A,{language:"ada",children:[(0,s.jsxs)(i.p,{children:["package Office is","\n","end Office;","\n","\n",(0,s.jsx)(l.A,{children:"26/2_10.1.2"})]}),(0,s.jsx)(o.A,{items:["AI95-00433-01"]}),(0,s.jsxs)(i.p,{children:["with Ada.Strings.Unbounded;","\n","package Office.Locations is","\n"," type Location is new Ada.Strings.Unbounded.Unbounded","_","String;","\n","end Office.Locations;","\n","\n",(0,s.jsx)(l.A,{children:"27/2_10.1.2"})]}),(0,s.jsx)(o.A,{items:["AI95-00433-01"]}),(0,s.jsxs)(i.p,{children:["limited with Office.Departments; -- types are incomplete","\n","private with Office.Locations; -- only visible in private part","\n","package Office.Employees is","\n"," type Employee is private;","\n","\n",(0,s.jsx)(l.A,{children:"28/2_10.1.2"}),"\nfunction Dept","_","Of(Emp : Employee) return access Departments.Department;","\n"," procedure Assign","_","Dept(Emp : in out Employee;","\n"," Dept : access Departments.Department);","\n","\n",(0,s.jsx)(l.A,{children:"29/2_10.1.2"}),"\n...","\n","private","\n"," type Employee is","\n"," record","\n"," Dept : access Departments.Department;","\n"," Loc : Locations.Location;","\n"," ...","\n"," end record;","\n","end Office.Employees;","\n","\n",(0,s.jsx)(l.A,{children:"30/5_10.1.2"})]}),(0,s.jsx)(o.A,{items:["AI12-0178-1"]}),(0,s.jsxs)(i.p,{children:["limited with Office.Employees;","\n","package Office.Departments is","\n"," type Department is ...;","\n","\n",(0,s.jsx)(l.A,{children:"31/2_10.1.2"}),"\nfunction Manager","_","Of(Dept : Department) return access Employees.Employee;","\n"," procedure Assign","_","Manager(Dept : in out Department;","\n"," Mgr : access Employees.Employee);","\n"," ...","\n","end Office.Departments;","\n"]})]}),"\n",(0,s.jsx)(l.A,{children:"32/5_10.1.2"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00433-01","AI12-0429-1","AI12-0440-1"]}),"\n",(0,s.jsxs)("p",{children:[(0,s.jsx)("i",{children:"The"})," ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0295",children:"limited_with_clause"})})," ",(0,s.jsx)("i",{children:"can be used to support mutually dependent abstractions that are split across multiple packages. In this case, an employee is assigned to a department, and a department has a manager who is an employee. If a"})," ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," ",(0,s.jsxs)("i",{children:["with the reserved word ",(0,s.jsx)("b",{children:"private"})," appears on one library unit and mentions a second library unit, it provides visibility to the second library unit, but restricts that visibility to the private part and body of the first unit. The compiler checks that no use is made of the second unit in the visible part of the first unit."]})," ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(d.A,{children:(0,s.jsx)(i.h4,{id:"extensions-to-ada-83-1",children:"Extensions to Ada 83"})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"32.a_10.1.2"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["The syntax rule for ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," is modified to allow expanded name notation.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"32.b_10.1.2"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["A ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.4#S0235",children:"use_clause"})})," in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})})," may be for a package (or type) nested in a library package. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(d.A,{children:(0,s.jsx)(i.h4,{id:"wording-changes-from-ada-83-2",children:"Wording Changes from Ada 83"})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"32.c_10.1.2"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["The syntax rule for ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})})," is modified to more closely reflect the semantics. The Ada 83 syntax rule implies that the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.4#S0235",children:"use_clause"})}),"s that appear immediately after a particular ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," are somehow attached to that ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),", which is not true. The new syntax allows a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.4#S0235",children:"use_clause"})})," to appear first, but that is prevented by a textual rule that already exists in Ada 83.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"32.d_10.1.2"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["The concept of \u201Cscope of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),"\u201D (which is a region of text) replaces RM83's notion of \u201Capply to\u201D (a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," applies to a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})}),") The visibility rules are interested in a region of text, not in a set of compilation units.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"32.e_10.1.2"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["No need to define \u201Capply to\u201D for ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.4#S0235",children:"use_clause"})}),"s. Their semantics are fully covered by the \u201Cscope (of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.4#S0235",children:"use_clause"})}),")\u201D definition in ",(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.4",children:"8.4"}),". ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(d.A,{children:(0,s.jsx)(i.h4,{id:"incompatibilities-with-ada-95",children:"Incompatibilities With Ada 95"})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"32.f/2_10.1.2"}),(0,s.jsx)(o.A,{items:["AI95-00220-01"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"correction",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{children:"Amendment "})," A subprogram body acting as a declaration cannot ",(0,s.jsx)("b",{children:"with"})," a private child unit. This would allow public export of types declared in private child packages, and thus cannot be allowed. This was allowed by mistake in Ada 95; a subprogram that does this will now be illegal. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(d.A,{children:(0,s.jsx)(i.h4,{id:"extensions-to-ada-95-1",children:"Extensions to Ada 95"})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"32.g/2_10.1.2"}),(0,s.jsx)(o.A,{items:["AI95-00217-06"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0295",children:"limited_with_clause"})}),"s are new. They make a limited view of a package visible, where all of the types in the package are incomplete. They facilitate construction of mutually recursive types in multiple packages.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"32.h/3_10.1.2"}),(0,s.jsx)(o.A,{items:["AI95-00262-01","AI05-0077-1"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["The syntax rules for ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," are modified to allow the reserved word ",(0,s.jsx)("b",{children:"private"}),". Private ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),"s do not allow the use of their ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," in the visible part of their ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0286",children:"compilation_unit"})}),". They also allow using private units in more locations than in Ada 95. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(d.A,{children:(0,s.jsx)(i.h4,{id:"incompatibilities-with-ada-2005",children:"Incompatibilities With Ada 2005"})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"32.i/3_10.1.2"}),(0,s.jsx)(o.A,{items:["AI05-0040-1"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"correction",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{})," Added missing rule that a limited with clause cannot name an ancestor unit. This is incompatible if an Ada 2005 program does this, but as this is a new Ada 2005 feature and the unintentionally allowed capability is not useful, the incompatibility is very unlikely to occur in practice. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(d.A,{children:(0,s.jsx)(i.h4,{id:"wording-changes-from-ada-2005-1",children:"Wording Changes from Ada 2005"})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"32.j/3_10.1.2"}),(0,s.jsx)(o.A,{items:["AI05-0077-1"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"correction",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{})," Fixed wording so that we are not checking whether something in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})})," is \u201Cwithin the scope of\u201D something, as ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})}),"s are never included in anything's scope. The intended meaning is unchanged, however.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"32.k/3_10.1.2"}),(0,s.jsx)(o.A,{items:["AI05-0122-1"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"correction",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),' Fixed wording so the rules for private with clauses also apply to "
1sprouted" generic child units. ',(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(d.A,{children:(0,s.jsx)(i.h4,{id:"wording-changes-from-ada-2012",children:"Wording Changes from Ada 2012"})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"32.l/5_10.1.2"}),(0,s.jsx)(o.A,{items:["AI12-0261-1"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"correction",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{})," Fixed wording so the privately withed units are visible in the subprogram specification of the body of a private descendant; otherwise, the private specification is legal but the completion is not. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)("a",{id:"Subclause_10.1.3"}),"\n",(0,s.jsx)(i.h2,{id:"1013--subunits-of-compilation-units",children:"10.1.3 Subunits of Compilation Units"}),"\n",(0,s.jsx)(l.A,{children:"1_10.1.3"}),"\n",(0,s.jsxs)("p",{children:["[Subunits are like child units, with these (important) differences: subunits support the separate compilation of bodies only (not declarations); the parent contains a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0297",children:"body_stub"})})," to indicate the existence and place of each of its subunits; declarations appearing in the parent's body can be visible within the subunits.] ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(i.h4,{id:"syntax-2",children:"Syntax"}),"\n",(0,s.jsx)(l.A,{children:"2_10.1.3"}),"\n",(0,s.jsx)(c.A,{children:(0,s.jsxs)(i.p,{children:[(0,s.jsxs)("code",{children:["body","_","stub"]}),(0,s.jsx)("a",{id:"S0297"}),(0,s.jsx)("code",{children:" ::= "}),(0,s.jsx)("br",{})," ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0298",children:"subprogram_body_stub"})})," | ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0299",children:"package_body_stub"})}),(0,s.jsx)("br",{})," | ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0300",children:"task_body_stub"})})," | ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0301",children:"protected_body_stub"})}),(0,s.jsx)("br",{})]})}),"\n",(0,s.jsx)(l.A,{children:"3/3_10.1.3"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00218-03","AI05-0267-1"]}),"\n",(0,s.jsx)(c.A,{children:(0,s.jsxs)(i.p,{children:[(0,s.jsxs)("code",{children:["subprogram","_","body","_","stub"]}),(0,s.jsx)("a",{id:"S0298"}),(0,s.jsx)("code",{children:" ::= "}),(0,s.jsx)("br",{})," [",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.3#S0234",children:"overriding_indicator"})}),"]",(0,s.jsx)("br",{})," ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.1#S0196",children:"subprogram_specification"})})," ",(0,s.jsx)("b",{children:"is"})," ",(0,s.jsx)("b",{children:"separate"}),(0,s.jsx)("br",{})," [",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-13/AA-13.1#S0346",children:"aspect_specification"})}),"];",(0,s.jsx)("br",{})]})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"3.a_10.1.3"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"discussion",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"Although this syntax allows a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0291",children:"parent_unit_name"})}),", that is disallowed by ",(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#Subclause_10.1.1",children:"10.1.1"}),", \u201C",(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#Subclause_10.1.1",children:"Compilation Units - Library Units"}),"\u201D. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"4/3_10.1.3"}),"\n",(0,s.jsx)(o.A,{items:["AI05-0267-1"]}),"\n",(0,s.jsx)(c.A,{children:(0,s.jsxs)(i.p,{children:[(0,s.jsxs)("code",{children:["package","_","body","_","stub"]}),(0,s.jsx)("a",{id:"S0299"}),(0,s.jsx)("code",{children:" ::= "}),(0,s.jsx)("br",{})," ",(0,s.jsx)("b",{children:"package"})," ",(0,s.jsx)("b",{children:"body"})," ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.1#S0022",children:"defining_identifier"})})," ",(0,s.jsx)("b",{children:"is"})," ",(0,s.jsx)("b",{children:"separate"}),(0,s.jsx)("br",{})," [",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-13/AA-13.1#S0346",children:"aspect_specification"})}),"];",(0,s.jsx)("br",{})]})}),"\n",(0,s.jsx)(l.A,{children:"5/3_10.1.3"}),"\n",(0,s.jsx)(o.A,{items:["AI05-0267-1"]}),"\n",(0,s.jsx)(c.A,{children:(0,s.jsxs)(i.p,{children:[(0,s.jsxs)("code",{children:["task","_","body","_","stub"]}),(0,s.jsx)("a",{id:"S0300"}),(0,s.jsx)("code",{children:" ::= "}),(0,s.jsx)("br",{})," ",(0,s.jsx)("b",{children:"task"})," ",(0,s.jsx)("b",{children:"body"})," ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.1#S0022",children:"defining_identifier"})})," ",(0,s.jsx)("b",{children:"is"})," ",(0,s.jsx)("b",{children:"separate"}),(0,s.jsx)("br",{})," [",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-13/AA-13.1#S0346",children:"aspect_specification"})}),"];",(0,s.jsx)("br",{})]})}),"\n",(0,s.jsx)(l.A,{children:"6/3_10.1.3"}),"\n",(0,s.jsx)(o.A,{items:["AI05-0267-1"]}),"\n",(0,s.jsx)(c.A,{children:(0,s.jsxs)(i.p,{children:[(0,s.jsxs)("code",{children:["protected","_","body","_","stub"]}),(0,s.jsx)("a",{id:"S0301"}),(0,s.jsx)("code",{children:" ::= "}),(0,s.jsx)("br",{})," ",(0,s.jsx)("b",{children:"protected"})," ",(0,s.jsx)("b",{children:"body"})," ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.1#S0022",children:"defining_identifier"})})," ",(0,s.jsx)("b",{children:"is"})," ",(0,s.jsx)("b",{children:"separate"}),(0,s.jsx)("br",{})," [",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-13/AA-13.1#S0346",children:"aspect_specification"})}),"];",(0,s.jsx)("br",{})]})}),"\n",(0,s.jsx)(l.A,{children:"7_10.1.3"}),"\n",(0,s.jsx)(c.A,{children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("code",{children:"subunit"}),(0,s.jsx)("a",{id:"S0302"}),(0,s.jsx)("code",{children:" ::= "}),(0,s.jsx)("b",{children:"separate"})," (",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0291",children:"parent_unit_name"})}),") ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.11#S0090",children:"proper_body"})}),(0,s.jsx)("br",{})]})}),"\n",(0,s.jsx)(i.h4,{id:"legality-rules-2",children:"Legality Rules"}),"\n",(0,s.jsx)(l.A,{children:"8/2_10.1.3"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00243-01"]}),"\n",(0,s.jsxs)("p",{children:["The ",(0,s.jsx)("i",{children:"parent body"})," of a subunit is the body of the program unit denoted by its ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0291",children:"parent_unit_name"})}),". The term ",(0,s.jsx)("i",{children:"subunit"})," is used to refer to a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0302",children:"subunit"})})," and also to the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.11#S0090",children:"proper_body"})})," of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0302",children:"subunit"})}),". The ",(0,s.jsx)("i",{children:"subunits of a program unit"})," include any subunit that names that program unit as its parent, as well as any subunit that names such a subunit as its parent (recursively). ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"8.a.1/2_10.1.3"}),(0,s.jsx)(o.A,{items:["AI95-00243-01"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"reason",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}
1),"We want any rule that applies to a subunit to apply to a subunit of a subunit as well. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"8.a/5_10.1.3"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{children:"Term entry: "}),(0,s.jsx)("b",{children:"subunit"})," \u2014 body of a program unit that can be compiled separately from its enclosing program unit",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"9_10.1.3"}),"\n",(0,s.jsxs)("p",{children:["The parent body of a subunit shall be present in the current environment, and shall contain a corresponding ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0297",children:"body_stub"})})," with the same ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.1#S0022",children:"defining_identifier"})})," as the subunit. ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"9.a_10.1.3"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"discussion",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"This can't be a Name Resolution Rule, because a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0302",children:"subunit"})})," is not a complete context. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"10/3_10.1.3"}),"\n",(0,s.jsx)(o.A,{items:["AI05-0004-1"]}),"\n",(0,s.jsxs)("p",{children:["A ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0299",children:"package_body_stub"})})," shall be the completion of a ",(0,s.jsx)("code",{children:(0,s.jsxs)("a",{href:"/docs/arm/AA-7/AA-7.1#S0229",children:["package","_","declaration"]})})," or ",(0,s.jsx)("code",{children:(0,s.jsxs)("a",{href:"/docs/arm/AA-12/AA-12.1#S0312",children:["generic","_","package","_","declaration"]})}),"; a ",(0,s.jsx)("code",{children:(0,s.jsxs)("a",{href:"/docs/arm/AA-10/AA-10.1#S0300",children:["task","_","body","_","stub"]})})," shall be the completion of a task declaration; a ",(0,s.jsx)("code",{children:(0,s.jsxs)("a",{href:"/docs/arm/AA-10/AA-10.1#S0301",children:["protected","_","body","_","stub"]})})," shall be the completion of a protected declaration.",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(l.A,{children:"11/5_10.1.3"}),"\n",(0,s.jsx)(o.A,{items:["AI12-0444-1"]}),"\n",(0,s.jsxs)("p",{children:["In contrast, a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0298",children:"subprogram_body_stub"})})," can be defined without it being the completion of a previous declaration, [in which case the ",(0,s.jsxs)("code",{children:["_","stub"]})," declares the subprogram]. If the ",(0,s.jsxs)("code",{children:["_","stub"]})," is a completion, it shall be the completion of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.1#S0195",children:"subprogram_declaration"})})," or ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-12/AA-12.1#S0311",children:"generic_subprogram_declaration"})}),". The profile of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0298",children:"subprogram_body_stub"})})," that completes a declaration shall conform fully to that of the declaration. ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"11.a_10.1.3"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"discussion",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"The part about ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0298",children:"subprogram_body_stub"})}),"s echoes the corresponding rule for ",(0,s.jsxs)("code",{children:["subprogram","_","bodies"]})," in ",(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.3",children:"6.3"}),", \u201C",(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.3",children:"Subprogram Bodies"}),"\u201D. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"12_10.1.3"}),"\n",(0,s.jsxs)("p",{children:["A subunit that corresponds to a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0297",children:"body_stub"})})," shall be of the same kind (",(0,s.jsxs)("code",{children:["package","_"]}),", ",(0,s.jsxs)("code",{children:["subprogram","_"]}),", ",(0,s.jsxs)("code",{children:["task","_"]}),", or ",(0,s.jsxs)("code",{children:["protected","_"]}),") as the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0297",children:"body_stub"})}),". The profile of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.3#S0216",children:"subprogram_body"})})," subunit shall be fully conformant to that of the corresponding ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0297",children:"body_stub"})}),". ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(l.A,{children:"13_10.1.3"}),"\n",(0,s.jsxs)("p",{children:["A ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0297",children:"body_stub"})})," shall appear immediately within the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.11#S0086",children:"declarative_part"})})," of a compilation unit body. This rule does not apply within an instance of a generic unit. ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"13.a_10.1.3"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"discussion",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"This is a methodological restriction; that is, it is not necessary for the semantics of the language to make sense. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"14_10.1.3"}),"\n",(0,s.jsxs)("p",{children:["The ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.1#S0022",children:"defining_identifier"})}),"s of all ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0297",children:"body_stub"})}),"s that appear immediately within a particular ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.11#S0086",children:"declarative_part"})})," shall be distinct. ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(i.h4,{id:"post-compilation-rules",children:"Post-Compilation Rules"}),"\n",(0,s.jsx)(l.A,{children:"15_10.1.3"}),"\n",(0,s.jsxs)("p",{children:["For each ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0297",children:"body_stub"})}),", there shall be a subunit containing the corresponding ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.11#S0090",children:"proper_body"})}),". ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"16_10.1.3"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["NOTE The rules in ",(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#Subclause_10.1.4",children:"10.1.4"}),", \u201C",(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#Subclause_10.1.4",children:"The Compilation Process"}),"\u201D say that a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0297",children:"body_stub"})})," is equivalent to the corresponding ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.11#S0090",children:"proper_body"})}),". This implies: ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"17_10.1.3"}),(0,s.jsx)("ul",{children:(0,s.jsxs)("li",{children:["Visibility within a subunit is the visibility that would be obtained at the place of the corresponding ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0297",children:"body_stub"})})," (within the parent body) if the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})})," of the subunit were appended to that of the parent body. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"17.a_10.1.3"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"ramification",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"Recursively. Note that this transformation might make the parent illegal; hence it is not a true equivalence, but applies only to visibility within the subunit. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"18_10.1.3"}),(0,s.jsx)("ul",{children:(0,s.jsxs)("li",{children:["The effect of the elaboration of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0297",children:"body_stub"})})," is to elaborate the subunit. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"18.a_10.1.3"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"ramification",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"The elaboration of a subunit is part of its parent body's elaboration, whereas the elaboration of a child unit is not part of its parent declaration's elaboration. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"18.b_10.1.3"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"ramification",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"A ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," that is mentioned in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," of a subunit can be hidden (from direct visibility) by a declaration (with the same ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-2/AA-2.3#S0002",children:"identifier"})}),") given in the subunit. Moreover, such a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," can even be hidden by a declaration given within the parent body since a library unit is declared in its parent's declarative region; this however does not affect the interpretation of the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),"s themselves, since only ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})}),"s are visible or directly visible in ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),"s.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"18.c_10.1.3"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["The body of a protected operation cannot be a subunit. This follows from the syntax rules. The body of a protected unit can be a subunit. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(i.h4,{id:"examples-2",children:"Examples"}
1),"\n",(0,s.jsx)(l.A,{children:"19/5_10.1.3"}),"\n",(0,s.jsx)(o.A,{items:["AI12-0429-1"]}),"\n",(0,s.jsxs)("p",{children:[(0,s.jsx)("i",{children:"Example that defines package Parent without subunits:"})," ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(l.A,{children:"20_10.1.3"}),"\n",(0,s.jsx)(c.A,{language:"ada",children:(0,s.jsxs)(i.p,{children:["package Parent is","\n"," procedure Inner;","\n","end Parent;","\n","\n",(0,s.jsx)(l.A,{children:"21_10.1.3"}),"\nwith Ada.Text","_","IO;","\n","package body Parent is","\n",' Variable : String := "Hello, there.";',"\n"," procedure Inner is","\n"," begin","\n"," Ada.Text","_","IO.Put","_","Line(Variable);","\n"," end Inner;","\n","end Parent;","\n"]})}),"\n",(0,s.jsx)(l.A,{children:"22/5_10.1.3"}),"\n",(0,s.jsx)(o.A,{items:["AI12-0429-1","AI12-0440-1"]}),"\n",(0,s.jsxs)("p",{children:[(0,s.jsx)("i",{children:"Example showing how the body of procedure Inner can be turned into a subunit by rewriting the package body as follows (with the declaration of Parent remaining the same):"})," ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(l.A,{children:"23_10.1.3"}),"\n",(0,s.jsx)(c.A,{language:"ada",children:(0,s.jsxs)(i.p,{children:["package body Parent is","\n",' Variable : String := "Hello, there.";',"\n"," procedure Inner is separate;","\n","end Parent;","\n","\n",(0,s.jsx)(l.A,{children:"24_10.1.3"}),"\nwith Ada.Text","_","IO;","\n","separate(Parent)","\n","procedure Inner is","\n","begin","\n"," Ada.Text","_","IO.Put","_","Line(Variable);","\n","end Inner;","\n"]})}),"\n",(0,s.jsx)(d.A,{children:(0,s.jsx)(i.h4,{id:"extensions-to-ada-83-2",children:"Extensions to Ada 83"})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"24.a_10.1.3"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Subunits of the same ancestor library unit are no longer restricted to have distinct identifiers. Instead, we require only that the full expanded names be distinct. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(d.A,{children:(0,s.jsx)(i.h4,{id:"extensions-to-ada-95-2",children:"Extensions to Ada 95"})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"24.b/2_10.1.3"}),(0,s.jsx)(o.A,{items:["AI95-00218-03"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["An ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.3#S0234",children:"overriding_indicator"})})," (see ",(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.3#Subclause_8.3.1",children:"8.3.1"}),") is allowed on a subprogram stub. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(d.A,{children:(0,s.jsx)(i.h4,{id:"wording-changes-from-ada-95-1",children:"Wording Changes from Ada 95"})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"24.c/2_10.1.3"}),(0,s.jsx)(o.A,{items:["AI95-00243-01"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Clarified that a subunit of a subunit is still a subunit. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(d.A,{children:(0,s.jsx)(i.h4,{id:"extensions-to-ada-2005",children:"Extensions to Ada 2005"})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"24.d/3_10.1.3"}),(0,s.jsx)(o.A,{items:["AI05-0267-1"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["An optional ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-13/AA-13.1#S0346",children:"aspect_specification"})})," can be used in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0297",children:"body_stub"})}),". This is described in ",(0,s.jsx)("a",{href:"/docs/arm/AA-13/AA-13.1#Subclause_13.1.1",children:"13.1.1"}),". ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)("a",{id:"Subclause_10.1.4"}),"\n",(0,s.jsx)(i.h2,{id:"1014--the-compilation-process",children:"10.1.4 The Compilation Process"}),"\n",(0,s.jsx)(l.A,{children:"1_10.1.4"}),"\n",(0,s.jsxs)("p",{children:["Each compilation unit submitted to the compiler is compiled in the context of an ",(0,s.jsx)("i",{children:"environment"})," ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.11#S0086",children:"declarative_part"})})," (or simply, an ",(0,s.jsx)("i",{children:"environment"}),"), which is a conceptual ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.11#S0086",children:"declarative_part"})})," that forms the outermost declarative region of the context of any ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0285",children:"compilation"})}),". At run time, an environment forms the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.11#S0086",children:"declarative_part"})})," of the body of the environment task of a partition (see ",(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.2",children:"10.2"}),", \u201C",(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.2",children:"Program Execution"}),"\u201D). ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"1.a_10.1.4"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"ramification",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"At compile time, there is no particular construct that the declarative region is considered to be nested within \u2014 the environment is the universe. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"1.b_10.1.4"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{children:"To be honest: "}),"The environment is really just a portion of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.11#S0086",children:"declarative_part"})}),", since there might, for example, be bodies that do not yet exist. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"2/5_10.1.4"}),"\n",(0,s.jsx)(o.A,{items:["AI12-0445-1"]}),"\n",(0,s.jsxs)("p",{children:["The ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-3/AA-3.11#S0087",children:"declarative_item"})}),"s of the environment are ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})}),"s appearing in an order such that there are no forward semantic dependences. Each included
1subunit occurs in place of the corresponding stub. The visibility rules apply as if the environment were the outermost declarative region, except that ",(0,s.jsx)("code",{children:(0,s.jsxs)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:["with","_","clause"]})}),"s are necessary to make declarations of library units visible (see ",(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#Subclause_10.1.2",children:"10.1.2"}),").",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(l.A,{children:"3/2_10.1.4"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00217-06"]}),"\n",(0,s.jsxs)("p",{children:["The mechanisms for creating an environment and for adding and replacing compilation units within an environment are implementation defined. The mechanisms for adding a compilation unit mentioned in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0295",children:"limited_with_clause"})})," to an environment are implementation defined. ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"3.a_10.1.4"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"implementation-defined",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"The mechanisms for creating an environment and for adding and replacing compilation units.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"3.a.1/2_10.1.4"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"implementation-defined",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"The mechanisms for adding a compilation unit mentioned in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0295",children:"limited_with_clause"})})," to an environment.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"3.b_10.1.4"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"ramification",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"The traditional model, used by most Ada 83 implementations, is that one places a compilation unit in the environment by compiling it. Other models are possible. For example, an implementation might define the environment to be a directory; that is, the compilation units in the environment are all the compilation units in the source files contained in the directory. In this model, the mechanism for replacing a compilation unit with a new one is simply to edit the source file containing that compilation unit. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(i.h4,{id:"name-resolution-rules-1",children:"Name Resolution Rules"}),"\n",(0,s.jsx)(l.A,{children:"4/3_10.1.4"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00192-01","AI05-0264-1"]}),"\n",(0,s.jsxs)("p",{children:["{",(0,s.jsx)("i",{children:"8652/0032"}),"}"," If a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0290",children:"library_unit_body"})})," that is a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.3#S0216",children:"subprogram_body"})})," is submitted to the compiler, it is interpreted only as a completion if a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0288",children:"library_unit_declaration"})})," with the same ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.1#S0201",children:"defining_program_unit_name"})})," already exists in the environment for a subprogram other than an instance of a generic subprogram or for a generic subprogram (even if the profile of the body is not type conformant with that of the declaration); otherwise, the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.3#S0216",children:"subprogram_body"})})," is interpreted as both the declaration and body of a library subprogram. ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"4.a_10.1.4"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"ramification",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"The principle here is that a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.3#S0216",children:"subprogram_body"})})," should be interpreted as only a completion if and only if it \u201Cmight\u201D be legal as the completion of some preexisting declaration, where \u201Cmight\u201D is defined in a way that does not require overload resolution to determine.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"4.b_10.1.4"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Hence, if the preexisting declaration is a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.1#S0195",children:"subprogram_declaration"})})," or ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-12/AA-12.1#S0311",children:"generic_subprogram_declaration"})}),", we treat the new ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.3#S0216",children:"subprogram_body"})})," as its completion, because it \u201Cmight\u201D be legal. If it turns out that the profiles don't fully conform, it's an error. In all other cases (the preexisting declaration is a package or a generic package, or an instance of a generic subprogram, or a renaming, or a \u201Cspec-less\u201D subprogram, or in the case where there is no preexisting thing), the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.3#S0216",children:"subprogram_body"})})," declares a new subprogram.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"4.c_10.1.4"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["See also AI83-00266/09. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(i.h4,{id:"legality-rules-3",children:"Legality Rules"}),"\n",(0,s.jsx)(l.A,{children:"5_10.1.4"}),"\n",(0,s.jsxs)("p",{children:["When a compilation unit is compiled, all c
1ompilation units upon which it depends semantically shall already exist in the environment; the set of these compilation units shall be ",(0,s.jsx)("i",{children:"consistent"})," in the sense that the new compilation unit shall not semantically depend (directly or indirectly) on two different versions of the same compilation unit, nor on an earlier version of itself. ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"5.a_10.1.4"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"discussion",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"For example, if package declarations A and B both say \u201C",(0,s.jsx)("b",{children:"with"})," X;\u201D, and the user compiles a compilation unit that says \u201C",(0,s.jsx)("b",{children:"with"})," A, B;\u201D, then the A and B have to be talking about the same version of X. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"5.b_10.1.4"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"ramification",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"What it means to be a \u201Cdifferent version\u201D is not specified by the language. In some implementations, it means that the compilation unit has been recompiled. In others, it means that the source of the compilation unit has been edited in some significant way.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"5.c_10.1.4"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:['Note that an implementation cannot require the existence of compilation units upon which the given one does not semantically depend. For example, an implementation is required to be able to compile a compilation unit that says "',(0,s.jsx)("b",{children:"with"})," A;\" when A's body does not exist. It has to be able to detect errors without looking at A's body.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"5.d/3_10.1.4"}),(0,s.jsx)(o.A,{items:["AI05-0229-1"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Similarly, the implementation has to be able to compile a call to a subprogram for which aspect Inline has been specified without seeing the body of that subprogram \u2014 inlining would not be achieved in this case, but the call is still legal.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"5.e/3_10.1.4"}),(0,s.jsx)(o.A,{items:["AI95-00217-06","AI05-0005-1"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["The consistency rule applies to limited views as well as the full view of a compilation unit. That means that an implementation needs a way to enforce consistency of limited views, not just of full views. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(i.h4,{id:"implementation-permissions-1",children:"Implementation Permissions"}),"\n",(0,s.jsx)(l.A,{children:"6/2_10.1.4"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00217-06"]}),"\n",(0,s.jsxs)("p",{children:["The implementation may require that a compilation unit be legal before it can be mentioned in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0295",children:"limited_with_clause"})})," or it can be inserted into the environment.",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(l.A,{children:"7/3_10.1.4"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00214-01","AI05-0229-1"]}),"\n",(0,s.jsxs)("p",{children:["When a compilation unit that declares or renames a library unit is added to the environment, the implementation may remove from the environment any preexisting ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," or ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0302",children:"subunit"})})," with the same full expanded name. When a compilation unit that is a subunit or the body of a library unit is added to the environment, the implementation may remove from the environment any preexisting version of the same compilation unit. When a compilation unit that contains a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0297",children:"body_stub"})})," is added to the environment, the implementation may remove any preexisting ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," or ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0302",children:"subunit"})})," with the same full expanded name as the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0297",children:"body_stub"})}),". When a given compilation unit is removed from the environment, the implementation may also remove any compilation unit that depends semantically upon the given one. If the given compilation unit contains the body of a subprogram for which aspect Inline is True, the implementation may also remove any compilation unit containing a call to that subprogram. ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"7.a/3_10.1.4"}),(0,s.jsx)(o.A,{items:["AI05-0005-1"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"ramification",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"The permissions given in this paragraph correspond to the traditional model, where compilation units enter the environment by being compiled into it, and the compiler checks their legality at that time. An implementation model in
1which the environment consists of all source files in a given directory might not want to take advantage of these permissions. Compilation units would not be checked for legality as soon as they enter the environment; legality checking would happen later, when compilation units are compiled. In this model, compilation units might never be automatically removed from the environment; they would be removed when the user explicitly deletes a source file.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"7.b_10.1.4"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Note that the rule is recursive: if the above permission is used to remove a compilation unit containing an inlined subprogram call, then compilation units that depend semantically upon the removed one may also be removed, and so on.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"7.c_10.1.4"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Note that here we are talking about dependences among existing compilation units in the environment; it doesn't matter what ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),"s are attached to the new compilation unit that triggered all this.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"7.d/3_10.1.4"}),(0,s.jsx)(o.A,{items:["AI05-0229-1"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["An implementation may have other modes in which compilation units in addition to the ones mentioned above are removed. For example, an implementation might inline subprogram calls without an explicit aspect Inline. If so, it either has to have a mode in which that optimization is turned off, or it has to automatically regenerate code for the inlined calls without requiring the user to resubmit them to the compiler. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"7.d.1/2_10.1.4"}),(0,s.jsx)(o.A,{items:["AI95-00077-01","AI95-00114-01"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"discussion",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"{",(0,s.jsx)("i",{children:"8652/0108"}),"}"," In the standard mode, implementations may only remove units from the environment for one of the reasons listed here, or in response to an explicit user command to modify the environment. It is not intended that the act of compiling a unit is one of the \u201Cmechanisms\u201D for removing units other than those specified by this document.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"7.e/2_10.1.4"}),(0,s.jsx)(o.A,{items:["AI95-00214-01"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["These rules are intended to ensure that an implementation never need keep more than one compilation unit with any full expanded name. In particular, it is not necessary to be able to have a subunit and a child unit with the same name in the environment at one time.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"8_10.1.4"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["NOTE 1 The rules of the language are enforced across ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0285",children:"compilation"})})," and compilation unit boundaries, just as they are enforced within a single compilation unit. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"8.a/3_10.1.4"}),(0,s.jsx)(o.A,{items:["AI05-0299-1"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"ramification",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"Note that Clause ",(0,s.jsx)("a",{href:"/docs/arm/AA-1/",children:"1"})," requires an implementation to detect illegal compilation units at compile time. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"9/5_10.1.4"}),(0,s.jsx)(o.A,{items:["AI12-0442-1"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["NOTE 2 An implementation can support a concept of a ",(0,s.jsx)("i",{children:"library"}),", which contains ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})}),"s. If multiple libraries are supported, the implementation can document how a single environment is constructed when a compilation unit is submitted to the compiler. Naming conflicts between different libraries can, for example, be resolved by treating each library as the root of a hierarchy of child library units. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"9.a_10.1.4"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"implementation-note",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"Alternatively, naming conflicts could be resolved via some sort of hiding rule. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"9.b_10.1.4"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"discussion",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"For example, the implementation might support a command to import library Y into library X. If a root library unit called LU (that is, Standard.LU) exists in Y, then from the point of view of library X, it could be called Y.LU. X might contain library units that say, \u201C",(0,s.jsx)("b",{children:"with"})," Y.LU;\u201D. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"10_10.1.4"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["NOTE 3 A compilation unit containing an instantiation of a separately compiled generic unit does not semantically depend on the body of the generic unit. Therefore, replacing the generic body in the environment does not result in the removal of the compilation unit containing the instantiation. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"10.a_10.1.4"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"implementation-note",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"Therefore, implementations have to be prepared to automatically instantiate generic bodies at link-time, as needed. This might imply a complete automatic recompilation, but it is the intent of the language that generic bodies can be (re)instantiated without forcing all of the compilation units that semantically depend on the compilation unit containing the instantiation to be recompiled. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(d.A,{children:(0,s.jsx)(i.h4,{id:"extensions-to-ada-83-3",children:"Extensions to Ada 83"})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"10.b/2_10.1.4"}),(0,s.jsx)(o.A,{items:["AI95-00077-01","AI95-00114-01"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Ada 83 allowed implementations to require that the body of a generic unit be available when the instantiation is compiled; that permission is dropped in Ada 95. This isn't really an extension (it doesn't allow Ada users to write anything that they couldn't in Ada 83), but there isn't a more appropriate category, and it does allow users more flexibility when developing programs. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(d.A,{children:(0,s.jsx)(i.h4,{id:"wording-changes-from-ada-95-2",children:"Wording Changes from Ada 95"})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"10.c/2_10.1.4"}),(0,s.jsx)(o.A,{items:["AI95-00192-01"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["{",(0,s.jsx)("i",{children:"8652/0032"}),"}"," ",(0,s.jsx)("b",{children:"Corrigendum:"})," The wording was clarified to ensure that a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.3#S0216",children:"subprogram_body"})})," is not considered a completion of an instance of a generic subprogram.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"10.d/2_10.1.4"}),(0,s.jsx)(o.A,{items:["AI95-00214-01"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["The permissions to remove a unit from the environment were clarified to ensure that it is never necessary to keep multiple (sub)units with the same full expanded name in the environment.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"10.e/2_10.1.4"}),(0,s.jsx)(o.A,{items:["AI95-00217-06"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Units mentioned in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0295",children:"limited_with_clause"})})," were added to several rules; limited views have the same presence in the environment as the corresponding full views. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)("a",{id:"Subclause_10.1.5"}),"\n",(0,s.jsx)(i.h2,{id:"1015--pragmas-and-program-units",children:"10.1.5 Pragmas and Program Units"}),"\n",(0,s.jsx)(l.A,{children:"1/5_10.1.5"}),"\n",(0,s.jsx)(o.A,{items:["AI12-0417-1"]}),"\n",(0,s.jsxs)("p",{children:["[This subclause discusses pragmas related to ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0285",children:"compilation"})}),"s.] ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)("p",{children:[(0,s.jsxs)("i",{children:["Paragraphs 2 through 7 were moved to ",(0,s.jsx)("a",{href:"/docs/arm/AA-J/",children:"Annex J"}),", \u201C",(0,s.jsx)("a",{href:"/docs/arm/AA-J/",children:"Obsolescent Features"}),"\u201D."]})," ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(i.h4,{id:"post-compilation-rules-1",children:"Post-Compilation Rules"}),"\n",(0,s.jsx)(l.A,{children:"8_10.1.5"}),"\n",(0,s.jsxs)("p",{children:["Certain ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-2/AA-2.8#S0019",children:"pragma"})}),"s are defined to be ",(0,s.jsx)("i",{children:"configuration pragmas"}),"; they shall appear before the first ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0286",children:"compilation_unit"})})," of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0285",children:"compilation"})}),". [They are generally used to select a partition-wide or system-wide option.] The ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-2/AA-2.8#S0019",children:"pragma"})})," applies to all ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0286",children:"compilation_unit"})}),"s appearing in the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0285",children:"compilation"})}),", unless there are none, in which case it applies to all future ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0286",children:"compilation_unit"})}),"s compiled into the same environment. ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(i.h4,{id:"implementation-permissions-2",children:"Implementation Permissions"}),"\n",(0,s.jsx)(l.A,{children:"9/2_10.1.5"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00212-01"]}),"\n",(0,s.jsxs)("p",{children:["An implementation may require that configuration pragmas that select partition-wide or system-wide options be compiled when the environment c
1ontains no ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})}),"s other than those of the predefined environment. In this case, the implementation shall still accept configuration pragmas in individual compilations that confirm the initially selected partition-wide or system-wide options.",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"10.a/5_10.1.5"}),(0,s.jsxs)(t.A,{type:"aarm",aarm:"note",children:[(0,s.jsx)("i",{children:"This paragraph was deleted."}),(0,s.jsx)("br",{})]})]}),"\n",(0,s.jsxs)("p",{children:[(0,s.jsxs)("i",{children:["Paragraph 10 was moved to ",(0,s.jsx)("a",{href:"/docs/arm/AA-J/",children:"Annex J"}),", \u201C",(0,s.jsx)("a",{href:"/docs/arm/AA-J/",children:"Obsolescent Features"}),"\u201D."]})," ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(d.A,{children:(0,s.jsx)(i.h4,{id:"wording-changes-from-ada-95-3",children:"Wording Changes from Ada 95"})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"10.b/5_10.1.5"}),(0,s.jsx)(o.A,{items:["AI95-00136-01","AI12-0417-1"]}),(0,s.jsxs)(t.A,{type:"aarm",aarm:"note",children:[(0,s.jsx)("i",{children:"This paragraph was deleted."}),"{",(0,s.jsx)("i",{children:"8652/0033"}),"}",(0,s.jsx)("br",{})]})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"10.c/5_10.1.5"}),(0,s.jsx)(o.A,{items:["AI95-00041-01","AI12-0417-1"]}),(0,s.jsxs)(t.A,{type:"aarm",aarm:"note",children:[(0,s.jsx)("i",{children:"This paragraph was deleted."}),"{",(0,s.jsx)("i",{children:"8652/0034"}),"}",(0,s.jsx)("br",{})]})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"10.d/5_10.1.5"}),(0,s.jsx)(o.A,{items:["AI12-0417-1"]}),(0,s.jsxs)(t.A,{type:"aarm",aarm:"note",children:[(0,s.jsx)("i",{children:"This paragraph was deleted."}),(0,s.jsx)("br",{})]})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"10.e/2_10.1.5"}),(0,s.jsx)(o.A,{items:["AI95-00212-01"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["The permission to place restrictions was clarified to: ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"10.f/2_10.1.5"}),(0,s.jsxs)("ul",{children:[(0,s.jsxs)("li",{children:["Ensure that it applies only to partition-wide configuration pragmas, not ones like Assertion","_","Policy (see ",(0,s.jsx)("a",{href:"/docs/arm/AA-11/AA-11.4#Subclause_11.4.2",children:"11.4.2"}),"), which can be different in different units; and",(0,s.jsx)("br",{})]}),(0,s.jsx)(l.A,{children:"10.g/2_10.1.5"}),(0,s.jsxs)("li",{children:["Ensure that confirming pragmas are always allowed. ",(0,s.jsx)("br",{})]})]})]}),"\n",(0,s.jsx)(d.A,{children:(0,s.jsx)(i.h4,{id:"wording-changes-from-ada-2005-2",children:"Wording Changes from Ada 2005"})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"10.h/5_10.1.5"}),(0,s.jsx)(o.A,{items:["AI05-0132-1","AI12-0417-1"]}),(0,s.jsxs)(t.A,{type:"aarm",aarm:"note",children:[(0,s.jsx)("i",{children:"This paragraph was deleted."}),(0,s.jsx)("br",{})]})]}),"\n",(0,s.jsx)(d.A,{children:(0,s.jsx)(i.h4,{id:"wording-changes-from-ada-2012-1",children:"Wording Changes from Ada 2012"})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"10.i/5_10.1.5"}),(0,s.jsx)(o.A,{items:["AI12-0417-1"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["The terms \u201Cprogram unit pragma\u201D and \u201Clibrary unit pragma\u201D were moved to ",(0,s.jsx)("a",{href:"/docs/arm/AA-J/",children:"Annex J"}),", \u201C",(0,s.jsx)("a",{href:"/docs/arm/AA-J/",children:"Obsolescent Features"}),"\u201D (specifically to ",(0,s.jsx)("a",{href:"/docs/arm/AA-J/AA-J.15",children:"J.15"}),") as all of the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-2/AA-2.8#S0019",children:"pragma"})}),"s that use these terms are now in that annex. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)("a",{id:"Subclause_10.1.6"}),"\n",(0,s.jsx)(i.h2,{id:"1016--environment-level-visibility-rules",children:"10.1.6 Environment-Level Visibility Rules"}),"\n",(0,s.jsx)(l.A,{children:"1_10.1.6"}),"\n",(0,s.jsxs)("p",{children:["[The normal visibility rules do not apply within a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0291",children:"parent_unit_name"})})," or a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})}),", nor within a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-2/AA-2.8#S0019",children:"pragma"})})," that appears at the place of a compilation unit. The special visibility rules for those contexts are given here.] ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(i.h4,{id:"static-semantics-1",children:"Static Semantics"}),"\n",(0,s.jsx)(l.A,{children:"2/2_10.1.6"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00217-06","AI95-00312-01"]}),"\n",(0,s.jsxs)("p",{children:["Within the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0291",children:"parent_unit_name"})})," at the beginning of an explicit ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})}),", and within a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0296",children:"nonlimited_with_clause"})}),", the only declarations that are visible are those that are explicit ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})}),"s of the environment, and the only declarations that are directly visible are those that are explicit root ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})}),"s of the environment. Within a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0295",children:"limited_with_clause"})}),", the only declarations that are visible are those that are the implicit declaration of the limited view of a library package of the environment, and the only declarations that are directly visible are those that are the implicit declaration of the limited view of a root library package.",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"2.a_10.1.6"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"ramification",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"In \u201C",(0,s.jsx)("b",{children:"package"})," P.Q.R ",(0,s.jsx)("b",{children:"is"})," ... ",(0,s.jsx)("b",{children:"end"})," P.Q.R;\u201D, this rule requires P to be a root library unit, and Q to be a library unit (because those are the things that are directly visible and visible). Note that visibility does not apply between the \u201C",(0,s.jsx)("b",{children:"end"}),"\u201D and the \u201C;\u201D.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"2.b_10.1.6"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Physically nested declarations are not visible at these places.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"2.c_10.1.6"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Although Standard is visible at these places, it is impossible to name it, since it is not directly visible, and it has no parent.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"2.c.1/2_10.1.6"}),(0,s.jsx)(o.A,{items:["AI95-00217-06"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Only compilation units defining limited views can be mentioned in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0295",children:"limited_with_clause"})}),", while only compilation units defining full views (that is, the explicit declarations) can be mentioned in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0296",children:"nonlimited_with_clause"})}),". This resolves the conflict inherent in having two compilation units with the same defining name. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"2.d/2_10.1.6"}),(0,s.jsx)(o.A,{items:["AI95-00312-01"]}),(0,s.jsxs)(t.A,{type:"aarm",aarm:"note",children:[(0,s.jsx)("i",{children:"This paragraph was deleted."}),(0,s.jsx)("br",{})]})]}),"\n",(0,s.jsx)(l.A,{children:"3_10.1.6"}),"\n",(0,s.jsxs)("p",{children:["Within a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.4#S0235",children:"use_clause"})})," or ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-2/AA-2.8#S0019",children:"pragma"})})," that is within a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})}),", each ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," mentioned in a previous ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," of the same ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})})," is visible, and each root ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," so mentioned is directly visible. In addition, within such a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.4#S0235",children:"use_clause"})}),", if a given declaration is visible or directly visible, each declaration that occurs immediately within the given declaration's visible part is also visible. No other declarations are visible or directly visible. ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"3.a_10.1.6"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"discussion",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"Note the word \u201Csame\u201D. For example, if a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})})," on a declaration mentions X, this does not make X visible in ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.4#S0235",children:"use_clause"})}),"s and ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-2/AA-2.8#S0019",children:"pragma"})}),"s that are on the body. The reason for this rule is the one-pass ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})}),"s Language Design Principle.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"3.b_10.1.6"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Note that the second part of the rule does not mention ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-2/AA-2.8#S0019",children:"pragma"})}),"s. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"4_10.1.6"}),"\n",(0,s.jsxs)("p",{children:["Within the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0291",children:"parent_unit_name"})})," of a subunit, ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})}),"s are visible as they are in the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0291",children:"parent_unit_name"})})," of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})}),"; in addition, the declaration corresponding to each ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0297",children:"body_stub"})})," in the environment is also visible. ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"4.a_10.1.6"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"ramification",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"For a subprogram without a separate ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-6/AA-6.1#S0195",children:"subprogram_declaration"})}),", the ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0297",children:"body_stub"})})," itself is the declaration. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(l.A,{children:"5_10.1.6"}),"\n",(0,s.jsxs)("p",{children:["Within a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-2/AA-2.8#S0019",children:"pragma"})})," that appears at the place of a compilation unit, the immediately preceding ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," and each of its ancestors is visible. The ancestor root ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0287",children:"library_item"})})," is directly visible.",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(l.A,{children:"6/2_10.1.6"}),"\n",(0,s.jsx)(o.A,{items:["AI95-00312-01"]}),"\n",(0,s.jsxs)("p",{children:["Notwithstanding the rules of ",(0,s.jsx)("a",{href:"/docs/arm/AA-4/AA-4.1#Subclause_4.1.3",children:"4.1.3"}),", an expanded name in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0294",children:"with_clause"})}),", a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-2/AA-2.8#S0019",children:"pragma"})})," in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})}),", or a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-2/AA-2.8#S0019",children:"pragma"})})," that appears at the place of a compilation unit may consist of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-4/AA-4.1#S0093",children:"prefix"})})," that denotes a generic package and a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-4/AA-4.1#S0099",children:"selector_name"})})," that denotes a child of that generic package. [(The child is necessarily a generic unit; see ",(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#Subclause_10.1.1",children:"10.1.1"}),".)] ",(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"6.a/2_10.1.6"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"reason",children:(0,s.jsxs)(i.p,{children:[(0,s.jsx)("b",{}),"This rule allows ",(0,s.jsx)("b",{children:"with"})," A.B; and ",(0,s.jsx)("b",{children:"pragma"})," Elaborate(A.B); where A is a generic library package and B is one of its (generic) children. This is necessary because it is not normally legal to use an expanded name to reach inside a generic package. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(d.A,{children:(0,s.jsx)(i.h4,{id:"wording-changes-from-ada-83-3",children:"Wording Changes from Ada 83"})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"6.b_10.1.6"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["The special visibility rules that apply within a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0291",children:"parent_unit_name"})})," or a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})}),", and within a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-2/AA-2.8#S0019",children:"pragma"})})," that appears at the place of a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0286",children:"compilation_unit"})})," are clarified.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"6.c_10.
11.6"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Note that a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})})," is not part of any declarative region.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"6.d_10.1.6"}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["We considered making the visibility rules within ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0291",children:"parent_unit_name"})}),"s and ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})}),"s follow from the context of compilation. However, this attempt failed for various reasons. For example, it would require ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-8/AA-8.4#S0235",children:"use_clause"})}),"s in ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})}),"s to be within the declarative region of Standard, which sounds suspiciously like a kludge. And we would still need a special rule to prevent seeing things (in our own ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})}),") that were with-ed by our parent, etc. ",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsx)(d.A,{children:(0,s.jsx)(i.h4,{id:"wording-changes-from-ada-95-4",children:"Wording Changes from Ada 95"})}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"6.e/2_10.1.6"}),(0,s.jsx)(o.A,{items:["AI95-00217-06"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Added separate visibility rules for ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0295",children:"limited_with_clause"})}),"s; the existing rules apply only to ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0296",children:"nonlimited_with_clause"})}),"s.",(0,s.jsx)("br",{})]})})]}),"\n",(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{children:"6.f/2_10.1.6"}),(0,s.jsx)(o.A,{items:["AI95-00312-01"]}),(0,s.jsx)(t.A,{type:"aarm",aarm:"note",children:(0,s.jsxs)(i.p,{children:["Clarified that the name of a generic child unit may appear in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-2/AA-2.8#S0019",children:"pragma"})})," in a ",(0,s.jsx)("code",{children:(0,s.jsx)("a",{href:"/docs/arm/AA-10/AA-10.1#S0292",children:"context_clause"})}),". ",(0,s.jsx)("br",{})]})})]})]})}function p(e={}){let{wrapper:i}={...(0,a.R)(),...e.components};return i?(0,s.jsx)(i,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.