Skip to content

Commit

Permalink
Reflow some lines on import clauses
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Jun 18, 2020
1 parent 4e3fdda commit 19f9ce0
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions chapters/packages.tex
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,8 @@ \subsubsection{Lookup of Imported Names}\doublelabel{lookup-of-imported-names}
Lookup of the name of an imported package or class deviates from the normal lexical lookup. For example, consider \lstinline!A.B.C! in the clauses \lstinline!import A.B.C;!, \lstinline!import D = A.B.C;!, or \lstinline!import A.B.C.*;!.
Here, lookup starts with the lexical lookup of the first part of the name (\lstinline!A!) at the top-level.

Qualified import clauses may only refer to packages or elements of
packages, i.e., in \lstinline!import A.B.C;! or \lstinline!import D=A.B.C;!,
\lstinline!A.B! must be a
package. Unqualified import clauses may only import from packages, i.e.,
in \lstinline!import A.B.*;!, \lstinline!A.B! must be a package.
Qualified import clauses may only refer to packages or elements of packages, i.e., in \lstinline!import A.B.C;! or \lstinline!import D = A.B.C;!, \lstinline!A.B! must be a package. Unqualified import clauses may only import
from packages, i.e., in \lstinline!import A.B.*;!, \lstinline!A.B! must be a package.

\begin{nonnormative}
In \lstinline!import A;! the class \lstinline!A! can be any class which is an element of the unnamed top-level package.
Expand All @@ -107,8 +104,7 @@ \subsubsection{Lookup of Imported Names}\doublelabel{lookup-of-imported-names}
\lstinline!Modelica.Math.ComplexNumbers!. $\mathit{definitionname}$ is the simple name without dot notation of a single definition that is imported. A $\mathit{shortname}$ is
a simple name without dot notation that can be used to refer to the package after import instead of the presumably much longer $\mathit{packagename}$.

The forms of \lstinline!import! are exemplified below assuming that we want to
access the addition operation of the hypothetical package \lstinline!Modelica.Math.ComplexNumbers!:
The forms of \lstinline!import! are exemplified below assuming that we want to access the addition operation of the hypothetical package \lstinline!Modelica.Math.ComplexNumbers!:
\begin{lstlisting}[language=modelica]
import Modelica.Math.ComplexNumbers; // Accessed by ComplexNumbers.Add
import Modelica.Math.ComplexNumbers.Add; // Accessed by Add
Expand Down

0 comments on commit 19f9ce0

Please sign in to comment.