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.6}} | 8 {\large Version 1.6}} |
9 %\author{The Dart Team} | 9 %\author{The Dart Team} |
10 \begin{document} | 10 \begin{document} |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 | 242 |
243 \rationale{Libraries do not reference each other by name and so the idea of a pr
ivate library is meaningless. | 243 \rationale{Libraries do not reference each other by name and so the idea of a pr
ivate library is meaningless. |
244 Thus, if the name of a library begins with an underscore, it has no effect on th
e accessibility of the library or its members. | 244 Thus, if the name of a library begins with an underscore, it has no effect on th
e accessibility of the library or its members. |
245 } | 245 } |
246 | 246 |
247 \rationale{Privacy is, at this point, a static notion tied to a particular piece
of code (a library). It is designed to support software engineering concerns ra
ther than security concerns. Untrusted code should always run in an another isol
ate. It is possible that libraries will become first class objects and privacy
will be a dynamic notion tied to a library instance. | 247 \rationale{Privacy is, at this point, a static notion tied to a particular piece
of code (a library). It is designed to support software engineering concerns ra
ther than security concerns. Untrusted code should always run in an another isol
ate. It is possible that libraries will become first class objects and privacy
will be a dynamic notion tied to a library instance. |
248 | 248 |
249 Privacy is indicated by the name of a declaration - hence privacy and naming are
not orthogonal. This has the advantage that both humans and machines can recogn
ize access to private declarations at the point of use without knowledge of the
context from which the declaration is derived.} | 249 Privacy is indicated by the name of a declaration - hence privacy and naming are
not orthogonal. This has the advantage that both humans and machines can recogn
ize access to private declarations at the point of use without knowledge of the
context from which the declaration is derived.} |
250 | 250 |
251 \subsection{Concurrency} | 251 \subsection{Concurrency} |
252 \LMLabel{concurrency} | |
253 | 252 |
254 Dart code is always single threaded. There is no shared-state concurrency in Dar
t. Concurrency is supported via actor-like entities called {\em isolates}. | 253 Dart code is always single threaded. There is no shared-state concurrency in Dar
t. Concurrency is supported via actor-like entities called {\em isolates}. |
255 | 254 |
256 An isolate is a unit of concurrency. It has its own memory and its own thread of
control. Isolates communicate by message passing (\ref{sendingMessages}). No st
ate is ever shared between isolates. Isolates are created by spawning (\ref{spaw
ningAnIsolate}). | 255 An isolate is a unit of concurrency. It has its own memory and its own thread of
control. Isolates communicate by message passing (\ref{sendingMessages}). No st
ate is ever shared between isolates. Isolates are created by spawning (\ref{spaw
ningAnIsolate}). |
257 | 256 |
258 | 257 |
259 \section{Errors and Warnings} | 258 \section{Errors and Warnings} |
260 \label{errorsAndWarnings} | 259 \label{errorsAndWarnings} |
261 | 260 |
262 This specification distinguishes between several kinds of errors. | 261 This specification distinguishes between several kinds of errors. |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 {\bf simpleFormalParameter:}declaredIdentifier; | 629 {\bf simpleFormalParameter:}declaredIdentifier; |
631 metadata identifier | 630 metadata identifier |
632 . | 631 . |
633 | 632 |
634 {\bf fieldFormalParameter:} | 633 {\bf fieldFormalParameter:} |
635 metadata finalConstVarOrType? \THIS{} `{\escapegrammar .}' identifier formalP
arameterList? | 634 metadata finalConstVarOrType? \THIS{} `{\escapegrammar .}' identifier formalP
arameterList? |
636 . | 635 . |
637 \end{grammar} | 636 \end{grammar} |
638 | 637 |
639 %\subsubsection{Rest Formals} | 638 %\subsubsection{Rest Formals} |
640 %\LMLabel{restFormals} | |
641 | 639 |
642 %A rest formal $R$ must be the last parameter in a formal parameter list. If a
type $T$ is specified for $R$, it signifies that the type of $R$ is $T[]$. | 640 %A rest formal $R$ must be the last parameter in a formal parameter list. If a
type $T$ is specified for $R$, it signifies that the type of $R$ is $T[]$. |
643 | 641 |
644 %\begin{grammar} | 642 %\begin{grammar} |
645 %restFormalParameter: | 643 %restFormalParameter: |
646 % finalConstVarOrType? '{\escapegrammar ...}' identifier | 644 % finalConstVarOrType? '{\escapegrammar ...}' identifier |
647 %\end{grammar} | 645 %\end{grammar} |
648 | 646 |
649 \subsubsection{Optional Formals} | 647 \subsubsection{Optional Formals} |
650 \label{optionalFormals} | 648 \label{optionalFormals} |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1122 `{\escapegrammar :}' \THIS{} (`{\escapegrammar .}' identifier)? arguments | 1120 `{\escapegrammar :}' \THIS{} (`{\escapegrammar .}' identifier)? arguments |
1123 . | 1121 . |
1124 \end{grammar} | 1122 \end{grammar} |
1125 | 1123 |
1126 % Need to specify exactly how executing a redirecting constructor works | 1124 % Need to specify exactly how executing a redirecting constructor works |
1127 | 1125 |
1128 | 1126 |
1129 %\Q{We now have generative constructors with no bodies as well.} | 1127 %\Q{We now have generative constructors with no bodies as well.} |
1130 | 1128 |
1131 \paragraph{Initializer Lists} | 1129 \paragraph{Initializer Lists} |
1132 \LMLabel{initializerLists} | |
1133 | 1130 |
1134 An initializer list begins with a colon, and consists of a comma-separated list
of individual {\em initializers}. There are two kinds of initializers. | 1131 An initializer list begins with a colon, and consists of a comma-separated list
of individual {\em initializers}. There are two kinds of initializers. |
1135 \begin{itemize} | 1132 \begin{itemize} |
1136 \item A {\em superinitializer} identifies a {\em superconstructor} - that is, a
specific constructor of the superclass. Execution of the superinitializer caus
es the initializer list of the superconstructor to be executed. | 1133 \item A {\em superinitializer} identifies a {\em superconstructor} - that is, a
specific constructor of the superclass. Execution of the superinitializer caus
es the initializer list of the superconstructor to be executed. |
1137 | 1134 |
1138 \item An {\em instance variable initializer} assigns a value to an individual in
stance variable. | 1135 \item An {\em instance variable initializer} assigns a value to an individual in
stance variable. |
1139 \end{itemize} | 1136 \end{itemize} |
1140 | 1137 |
1141 \begin{grammar} | 1138 \begin{grammar} |
1142 {\bf initializers:} | 1139 {\bf initializers:} |
(...skipping 2128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3271 \commentary{ | 3268 \commentary{ |
3272 The implication of this definition, and the other definitions involving the meth
od \code{call()}, is that user defined types can be used as function values prov
ided they define a \CALL{} method. The method \CALL{} is special in this regard.
The signature of the \CALL{} method determines the signature used when using th
e object via the built-in invocation syntax. | 3269 The implication of this definition, and the other definitions involving the meth
od \code{call()}, is that user defined types can be used as function values prov
ided they define a \CALL{} method. The method \CALL{} is special in this regard.
The signature of the \CALL{} method determines the signature used when using th
e object via the built-in invocation syntax. |
3273 } | 3270 } |
3274 | 3271 |
3275 It is a static warning if the static type $F$ of $e_f$ may not be assigned to a
function type. If $F$ is not a function type, the static type of $i$ is \DYNAMI
C{}. Otherwise | 3272 It is a static warning if the static type $F$ of $e_f$ may not be assigned to a
function type. If $F$ is not a function type, the static type of $i$ is \DYNAMI
C{}. Otherwise |
3276 the static type of $i$ is the declared return type of $F$. | 3273 the static type of $i$ is the declared return type of $F$. |
3277 %\item Let $T_i$ be the static type of $a_i, i \in 1 .. n+k$. It is a static war
ning if $F$ is not a supertype of $(T_1, \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldot
s, T_{n+k}$ $x_{n+k}]) \to \bot$. | 3274 %\item Let $T_i$ be the static type of $a_i, i \in 1 .. n+k$. It is a static war
ning if $F$ is not a supertype of $(T_1, \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldot
s, T_{n+k}$ $x_{n+k}]) \to \bot$. |
3278 %\end{itemize} | 3275 %\end{itemize} |
3279 | 3276 |
3280 \subsection{ Lookup} | 3277 \subsection{ Lookup} |
3281 \LMLabel{lookup} | |
3282 | 3278 |
3283 \subsubsection{Method Lookup} | 3279 \subsubsection{Method Lookup} |
3284 \label{methodLookup} | 3280 \label{methodLookup} |
3285 | 3281 |
3286 The result of a lookup of a method $m$ in object $o$ with respect to library $L$
is the result of a lookup of method $m$ in class $C$ with respect to library $
L$, where $C$ is the class of $o$. | 3282 The result of a lookup of a method $m$ in object $o$ with respect to library $L$
is the result of a lookup of method $m$ in class $C$ with respect to library $
L$, where $C$ is the class of $o$. |
3287 | 3283 |
3288 The result of a lookup of method $m$ in class $C$ with respect to library $L$ i
s: | 3284 The result of a lookup of method $m$ in class $C$ with respect to library $L$ i
s: |
3289 If $C$ declares a concrete instance method named $m$ that is accessible to $L$,
then that method is the result of the lookup. Otherwise, if $C$ has a superclas
s $S$, then the result of the lookup is the result of looking up $m$ in $S$ wit
h respect to $L$. Otherwise, we say that the method lookup has failed. | 3285 If $C$ declares a concrete instance method named $m$ that is accessible to $L$,
then that method is the result of the lookup. Otherwise, if $C$ has a superclas
s $S$, then the result of the lookup is the result of looking up $m$ in $S$ wit
h respect to $L$. Otherwise, we say that the method lookup has failed. |
3290 | 3286 |
3291 \rationale { | 3287 \rationale { |
(...skipping 3079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6371 | 6367 |
6372 The scope of a documentation comment immediately preceding the declaration of a
class $C$ is the instance scope of $C$, excluding any names introduced via the i
mport namespace of the enclosing library. | 6368 The scope of a documentation comment immediately preceding the declaration of a
class $C$ is the instance scope of $C$, excluding any names introduced via the i
mport namespace of the enclosing library. |
6373 | 6369 |
6374 The scope of a documentation comment immediately preceding the declaration of a
function $f$ is the scope in force at the very beginning of the body of $f$,
excluding any names introduced via the import namespace of the enclosing library
. | 6370 The scope of a documentation comment immediately preceding the declaration of a
function $f$ is the scope in force at the very beginning of the body of $f$,
excluding any names introduced via the import namespace of the enclosing library
. |
6375 | 6371 |
6376 | 6372 |
6377 | 6373 |
6378 | 6374 |
6379 | 6375 |
6380 %\subsection{Grammar} | 6376 %\subsection{Grammar} |
6381 %\LMLabel{grammar} | |
6382 \subsection{Operator Precedence} | 6377 \subsection{Operator Precedence} |
6383 \label{operatorPrecedence} | 6378 \label{operatorPrecedence} |
6384 | 6379 |
6385 Operator precedence is given implicitly by the grammar. | 6380 Operator precedence is given implicitly by the grammar. |
6386 | 6381 |
6387 \commentary{The following non-normative table may be helpful | 6382 \commentary{The following non-normative table may be helpful |
6388 \newline | 6383 \newline |
6389 | 6384 |
6390 \begin{tabular}{| r | r | r | r |} | 6385 \begin{tabular}{| r | r | r | r |} |
6391 \hline | 6386 \hline |
(...skipping 25 matching lines...) Expand all Loading... |
6417 \hline | 6412 \hline |
6418 Conditional & e1? e2: e3 & None & 3\\ | 6413 Conditional & e1? e2: e3 & None & 3\\ |
6419 \hline | 6414 \hline |
6420 Cascade & .. & Left & 2\\ | 6415 Cascade & .. & Left & 2\\ |
6421 \hline | 6416 \hline |
6422 Assignment & =, *=, /=, +=, -= ,\&=, \^{}= etc. & Right & 1\\ | 6417 Assignment & =, *=, /=, +=, -= ,\&=, \^{}= etc. & Right & 1\\ |
6423 \hline | 6418 \hline |
6424 \end{tabular} | 6419 \end{tabular} |
6425 } | 6420 } |
6426 %\subsection{Glossary} | 6421 %\subsection{Glossary} |
6427 %\LMLabel{glossary} | |
6428 | 6422 |
6429 %\bibliographystyle{alpha} | 6423 %\bibliographystyle{alpha} |
6430 %\bibliography{/users/gilad/research/bibs/master} | 6424 %\bibliography{/users/gilad/research/bibs/master} |
6431 \section*{Appendix: Naming Conventions} | 6425 \section*{Appendix: Naming Conventions} |
6432 \LMLabel{namingConventions} | |
6433 | 6426 |
6434 \commentary{ | 6427 \commentary{ |
6435 The following naming conventions are customary in Dart programs. | 6428 The following naming conventions are customary in Dart programs. |
6436 \begin{itemize} | 6429 \begin{itemize} |
6437 \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. | 6430 \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. |
6438 \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 | 6431 \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 |
6439 \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. | 6432 \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. |
6440 \item The names of type variables are short (preferably single letter). Examples
: T, S, K, V , E. | 6433 \item The names of type variables are short (preferably single letter). Examples
: T, S, K, V , E. |
6441 \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. | 6434 \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. |
6442 \end{itemize} | 6435 \end{itemize} |
6443 } | 6436 } |
6444 | 6437 |
6445 | 6438 |
6446 \end{document} | 6439 \end{document} |
OLD | NEW |