OLD | NEW |
1 \documentclass{article} | 1 \documentclass{article} |
2 \usepackage{epsfig} | 2 \usepackage{epsfig} |
3 \usepackage{dart} | 3 \usepackage{dart} |
4 \usepackage{bnf} | 4 \usepackage{bnf} |
5 \usepackage{hyperref} | 5 \usepackage{hyperref} |
6 \newcommand{\code}[1]{{\sf #1}} | 6 \newcommand{\code}[1]{{\sf #1}} |
7 \title{Dart Programming Language Specification \\ | 7 \title{Dart Programming Language Specification \\ |
8 {\large Version 1.4}} | 8 {\large Version 1.4}} |
9 %\author{The Dart Team} | 9 %\author{The Dart Team} |
10 \begin{document} | 10 \begin{document} |
(...skipping 1726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1737 | 1737 |
1738 %Let $I$ be the implicit interface of a class $C$. $I$ inherits any instance me
mbers of its superinterfaces that are not overridden by members declared in $C$.
| 1738 %Let $I$ be the implicit interface of a class $C$. $I$ inherits any instance me
mbers of its superinterfaces that are not overridden by members declared in $C$.
|
1739 | 1739 |
1740 % tighten definition? do we need chain as for classes? Definition for interface
override? | 1740 % tighten definition? do we need chain as for classes? Definition for interface
override? |
1741 | 1741 |
1742 However, if the above rules would cause multiple members $m_1, \ldots, m_k$ wit
h the same name $n$ to be inherited (because identically named members existed i
n several superinterfaces) then at most one member is inherited. | 1742 However, if the above rules would cause multiple members $m_1, \ldots, m_k$ wit
h the same name $n$ to be inherited (because identically named members existed i
n several superinterfaces) then at most one member is inherited. |
1743 | 1743 |
1744 If some but not all of the $m_i, 1 \le i \le k$ are getters none of the $m_i$ ar
e inherited, and a static warning is issued. | 1744 If some but not all of the $m_i, 1 \le i \le k$ are getters none of the $m_i$ ar
e inherited, and a static warning is issued. |
1745 | 1745 |
1746 Otherwise, if the static types $T_1, \ldots, T_k$ of the members $m_1, \ldots,
m_k$ are not identical, then there must be a member $m_x$ such that $T_x <: T_
i, 1 \le x \le k$ for all $i \in 1..k$, or a static type warning occurs. The m
ember that is inherited is $m_x$, if it exists; otherwise: | 1746 Otherwise, if the static types $T_1, \ldots, T_k$ of the members $m_1, \ldots,
m_k$ are not identical, then there must be a member $m_x$ such that $T_x <: T_
i, 1 \le x \le k$ for all $i \in 1..k$, or a static type warning occurs. The m
ember that is inherited is $m_x$, if it exists; otherwise: |
1747 \begin{itemize} | 1747 let $numberOfPositionals(f)$ denote the number of positional parameters of a fu
nction $f$, and let $numberOfRequiredParams(f)$ denote the number of required pa
rameters of a function $f$. Furthermore, let $s$ denote the set of all named par
ameters of the $m_1, \ldots, m_k$. Then let |
1748 \item Let $numberOfPositionals(f)$ denote the number of positional parameters of
a function $f$, and let $numberOfRequiredParams(f)$ denote the number of requir
ed parameters of a function $f$. Furthermore, let $s$ denote the set of all name
d parameters of the $m_1, \ldots, m_k$. Then let | |
1749 | 1748 |
1750 $h = max(numberOfPositionals(m_i)), $ | 1749 $h = max(numberOfPositionals(m_i)), $ |
1751 | 1750 |
1752 $r = min(numberOfRequiredParams(m_i)), i \in 1..k$. | 1751 $r = min(numberOfRequiredParams(m_i)), i \in 1..k$. |
1753 | 1752 |
1754 If $r \le h$ then $I$ has a method named $n$, with $r$ required parameters of ty
pe \DYNAMIC{}, $h$ positional parameters of type \DYNAMIC{}, named parameters $
s$ of type \DYNAMIC{} and return type \DYNAMIC{}. | 1753 Then $I$ has a method named $n$, with $r$ required parameters of type \DYNAMIC{}
, $h$ positional parameters of type \DYNAMIC{}, named parameters $s$ of type \
DYNAMIC{} and return type \DYNAMIC{}. |
1755 \item Otherwise none of the members $m_1, \ldots, m_k$ is inherited. | 1754 |
1756 \end{itemize} | 1755 |
1757 | 1756 |
1758 \commentary{The only situation where the runtime would be concerned with this wo
uld be during reflection, if a mirror attempted to obtain the signature of an in
terface member. | 1757 \commentary{The only situation where the runtime would be concerned with this wo
uld be during reflection, if a mirror attempted to obtain the signature of an in
terface member. |
1759 } | 1758 } |
1760 | 1759 |
1761 \rationale{ | 1760 \rationale{ |
1762 The current solution is a tad complex, but is robust in the face of type annotat
ion changes. Alternatives: (a) No member is inherited in case of conflict. (b)
The first m is selected (based on order of superinterface list) (c) Inherited me
mber chosen at random. | 1761 The current solution is a tad complex, but is robust in the face of type annotat
ion changes. Alternatives: (a) No member is inherited in case of conflict. (b)
The first m is selected (based on order of superinterface list) (c) Inherited me
mber chosen at random. |
1763 | 1762 |
1764 (a) means that the presence of an inherited member of an interface varies depend
ing on type signatures. (b) is sensitive to irrelevant details of the declarati
on and (c) is liable to give unpredictable results between implementations or ev
en between different compilation sessions. | 1763 (a) means that the presence of an inherited member of an interface varies depend
ing on type signatures. (b) is sensitive to irrelevant details of the declarati
on and (c) is liable to give unpredictable results between implementations or ev
en between different compilation sessions. |
1765 } | 1764 } |
1766 | 1765 |
(...skipping 4170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5937 \item The names of compile time constant variables never use lower case letters.
If they consist of multiple words, those words are separated by underscores. Ex
amples: PI, I\_AM\_A\_CONSTANT. | 5936 \item The names of compile time constant variables never use lower case letters.
If they consist of multiple words, those words are separated by underscores. Ex
amples: PI, I\_AM\_A\_CONSTANT. |
5938 \item The names of functions (including getters, setters, methods and local or l
ibrary functions) and non-constant variables begin with a lowercase letter. If t
he name consists of multiple words, each word (except the first) begins with an
uppercase letter. No other uppercase letters are used. Examples: camlCase, dar
t4TheWorld | 5937 \item The names of functions (including getters, setters, methods and local or l
ibrary functions) and non-constant variables begin with a lowercase letter. If t
he name consists of multiple words, each word (except the first) begins with an
uppercase letter. No other uppercase letters are used. Examples: camlCase, dar
t4TheWorld |
5939 \item The names of types (including classes and type aliases) begin with an uppe
r case letter. If the name consists of multiple words, each word begins with
an uppercase letter. No other uppercase letters are used. Examples: CamlCase, D
art4TheWorld. | 5938 \item The names of types (including classes and type aliases) begin with an uppe
r case letter. If the name consists of multiple words, each word begins with
an uppercase letter. No other uppercase letters are used. Examples: CamlCase, D
art4TheWorld. |
5940 \item The names of type variables are short (preferably single letter). Examples
: T, S, K, V , E. | 5939 \item The names of type variables are short (preferably single letter). Examples
: T, S, K, V , E. |
5941 \item The names of libraries or library prefixes never use upper case letters. I
f they consist of multiple words, those words are separated by underscores. Exam
ple: my\_favorite\_library. | 5940 \item The names of libraries or library prefixes never use upper case letters. I
f they consist of multiple words, those words are separated by underscores. Exam
ple: my\_favorite\_library. |
5942 \end{itemize} | 5941 \end{itemize} |
5943 } | 5942 } |
5944 | 5943 |
5945 | 5944 |
5946 \end{document} | 5945 \end{document} |
OLD | NEW |