Skip to content

Commit 3b76bc4

Browse files
committed
docs: Update generics.tex
1 parent a7522b2 commit 3b76bc4

28 files changed

+3231
-2847
lines changed

docs/Generics/README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,16 @@ The following chapters need some editing:
6363

6464
- Part II:
6565
- Substitution Maps
66-
- Conformances
6766
- Part III:
6867
- Conformance Paths
6968
- Part V:
70-
- Symbols, Terms, and Rules
7169
- Completion
72-
- Type Substitution Summary
7370

7471
The following chapters are not yet written:
7572

7673
- Part IV:
7774
- Opaque Return Types
7875
- Existential Types
79-
- Subclassing
8076
- Part V:
8177
- The Property Map
82-
- Concrete Conformances
8378
- Rule Minimization

docs/Generics/chapters/archetypes.tex

Lines changed: 84 additions & 79 deletions
Large diffs are not rendered by default.

docs/Generics/chapters/basic-operation.tex

Lines changed: 64 additions & 57 deletions
Large diffs are not rendered by default.

docs/Generics/chapters/building-generic-signatures.tex

Lines changed: 234 additions & 131 deletions
Large diffs are not rendered by default.

docs/Generics/chapters/class-inheritance.tex

Lines changed: 0 additions & 884 deletions
This file was deleted.

docs/Generics/chapters/compilation-model.tex

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ \chapter{Compilation Model}\label{compilation model}
1616
\IndexDefinition{top-level code declaration}
1717
Executables must define a \emph{main function}, which is the entry point invoked when the executable is run. There are three mechanisms for doing so:
1818
\begin{enumerate}
19-
\item If only a single source file was provided, this file becomes the \emph{main source file} of the module. If there are multiple source files and one of them is named \texttt{main.swift}, then this file becomes the main source file. The main source file is special, in that it can contain statements at the top level, outside of a function body. Top-level statements are collected into \emph{top-level code declarations}, and the frontend generates a main function which executes each top-level code declaration in source order. Source files other than the main source file cannot contain statements at the top level.
20-
\item In the absence of a main source file, a struct, enum or class declaration can instead be annotated with the \texttt{@main} attribute, in which case the declaration must contain a static method named \texttt{main()}. This method becomes the main entry point. This attribute was introduced in \IndexSwift{5.3}Swift 5.3~\cite{se0281}.
21-
\item The older \texttt{@NSApplicationMain} and \texttt{@UIApplicationMain} attributes, deprecated since \IndexSwift{[email protected]}Swift 5.10~\cite{se0383}, provided a similar mechanism specific to Apple platforms. Attaching one of these attributes to a class conforming to \texttt{NSApplicationMain} or \texttt{UIApplicationMain}, respectively, will generate a main entry point which calls the \texttt{NSApplicationMain()} or \texttt{UIApplicationMain()} system framework function.
19+
\item If the user invokes the driver with a single source file, this file becomes the \emph{main source file} of the module. If there are multiple source files and one of them is named \texttt{main.swift}, then this file becomes the main source file. The main source file is special, in that it can contain statements at the top level, outside of a function body. Top-level statements are collected into \emph{top-level code declarations}, and the frontend generates a main function which executes each top-level code declaration in source order. Source files other than the main source file cannot contain statements at the top level.
20+
\item In the absence of a main source file, the user can annotate a struct, enum or class declaration with the \texttt{@main} attribute, in which case the declaration must contain a static method named \texttt{main()}. This method becomes the main entry point. This attribute was introduced in \IndexSwift{5.3}Swift 5.3~\cite{se0281}.
21+
\item The older \texttt{@NSApplicationMain} and \texttt{@UIApplicationMain} attributes, deprecated since \IndexSwift{[email protected]}Swift 5.10~\cite{se0383}, provide a similar mechanism specific to Apple platforms. Attaching one of these attributes to a class conforming to \texttt{NSApplicationMain} or \texttt{UIApplicationMain}, respectively, will generate a main entry point which calls the \texttt{NSApplicationMain()} or \texttt{UIApplicationMain()} system framework function.
2222
\end{enumerate}
2323

2424
Invoking the driver with the \IndexFlag{emit-library}\texttt{-emit-library} and \IndexFlag{emit-module}\texttt{-emit-module} flags instructs it to generate a shared library, together with the serialized module file consumed by the compiler when importing the library (\SecRef{module system}):
@@ -468,7 +468,7 @@ \section{Incremental Builds}\label{incremental builds}
468468

469469
\section{Module System}\label{module system}
470470

471-
The frontend represents a module by a \IndexDefinition{module declaration}\emph{module declaration} containing one or more \IndexDefinition{file unit}\emph{file units}. The list of source files in a compiler invocation form the \IndexDefinition{main module}\emph{main module}. The main module is special, because its \index{abstract syntax tree}abstract syntax tree is constructed directly by parsing source code; the file units are \IndexDefinition{source file}\emph{source files}. There are three other kinds of modules:
471+
The frontend represents a module by a \IndexDefinition{module declaration}\emph{module declaration} containing one or more \IndexDefinition{file unit}\emph{file units}. The list of source files in a compiler invocation form the \index{main module}\emph{main module}. The main module is special, because its \index{abstract syntax tree}abstract syntax tree is constructed directly by parsing source code; the file units are \IndexDefinition{source file}\emph{source files}. There are three other kinds of modules:
472472
\begin{itemize}
473473
\item \textbf{Serialized modules} containing one or more \IndexDefinition{serialized AST file unit}\emph{serialized AST file units}. When the main module imports another module written in Swift, the frontend reads a serialized module that was previously built.
474474

@@ -518,7 +518,7 @@ \section{Module System}\label{module system}
518518

519519
When a module defined by a textual interface is imported for the first time, a frontend job parses and type checks the textual interface, and generates a serialized module file which is then consumed by the original frontend job. Serialized module files generated in this manner are cached, and can be reused between invocations of the same compiler version.
520520

521-
The \texttt{@inlinable} attribute was introduced in \IndexSwift{4.2}Swift 4.2~\cite{se0193}. The Swift \index{ABI}ABI was formally stabilized in \IndexSwift{5.0}Swift 5, when the standard library became part of the operating system on Apple platforms. Library evolution support and textual interfaces became user-visible features in \IndexSwift{5.1}Swift 5.1~\cite{se0260}.
521+
The \texttt{@inlinable} attribute was introduced in \IndexSwift{4.2}Swift 4.2~\cite{se0193}. The Swift \index{ABI}ABI was formally stabilized in \IndexSwift{5.0}Swift 5, when the standard library became part of the operating system on Apple platforms. Library evolution support and textual interfaces became user-visible features in \IndexSwift{5.1}Swift 5.1~\cite{se0260}. A recent paper describes a formal model for reasoning about the Swift ABI \cite{formalabi}.
522522

523523
\section{Source Code Reference}\label{compilation model source reference}
524524

@@ -641,12 +641,10 @@ \subsection*{Name Lookup}
641641
\item \texttt{UnqualifiedLookupFlags::IncludeOuterResults} if set, lookup stops after finding results in an innermost scope, or to always proceed to a top-level lookup.
642642
\end{itemize}
643643

644-
\index{declaration context}
645-
\IndexSource{qualified lookup}
646644
\apiref{DeclContext}{class}
647-
Declaration contexts will be introduced in \ChapRef{decls}, and the \texttt{DeclContext} class in \SecRef{declarationssourceref}.
645+
Declaration contexts will be \IndexSource{declaration context}introduced in \ChapRef{decls}, and the \texttt{DeclContext} class in \SecRef{declarationssourceref}.
648646
\begin{itemize}
649-
\item \texttt{lookupQualified()} has various overloads, which perform a qualified name lookup into one of various combinations of types or declarations. The ``\texttt{this}'' parameter---the \texttt{DeclContext~*} which the method is called on determines the visibility of declarations found via lookup through imports and access control; it is not the base type of the lookup.
647+
\item \texttt{lookupQualified()} has various overloads, which perform a \IndexSource{qualified lookup}qualified name lookup into one of various combinations of types or declarations. The ``\texttt{this}'' parameter---the \texttt{DeclContext~*} which the method is called on determines the visibility of declarations found via lookup through imports and access control; it is not the base type of the lookup.
650648
\end{itemize}
651649

652650
\apiref{NLOptions}{enum}

0 commit comments

Comments
 (0)