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 Draft Version 0.61}} | 8 {\large Draft Version 0.61}} |
9 \author{The Dart Team} | 9 \author{The Dart Team} |
10 \begin{document} | 10 \begin{document} |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
476 \ref{variables}: Type promotion support added. | 476 \ref{variables}: Type promotion support added. |
477 | 477 |
478 \ref{formalParameters}: refined scope rules. | 478 \ref{formalParameters}: refined scope rules. |
479 | 479 |
480 \ref{classes}: Banned name clashes between type variables and members etc. | 480 \ref{classes}: Banned name clashes between type variables and members etc. |
481 | 481 |
482 \ref{factories}: Banned default values in redirecting factories. | 482 \ref{factories}: Banned default values in redirecting factories. |
483 | 483 |
484 \ref{constants}: Added constant conditional expressions. | 484 \ref{constants}: Added constant conditional expressions. |
485 | 485 |
486 \ref{strings}: Allow adjacent single and multiine strings to concatenate. Allow escaped newlines in multiline strings. | 486 \ref{strings}: Allow adjacent single and multiline strings to concatenate. Allow escaped newlines in multiline strings. |
487 | 487 |
488 \ref{conditional}: Type promotion support added. | 488 \ref{conditional}: Type promotion support added. |
489 | 489 |
490 \ref{logicalBooleanExpressions}: Type promotion support added. | 490 \ref{logicalBooleanExpressions}: Type promotion support added. |
491 | 491 |
492 \ref{logicalBooleanExpressions} - \ref{bitwiseExpressions}, \ref{operatorPrecede nce}: Increased precedence of bitwise operations to be higher than equality and relational expressions. | 492 \ref{logicalBooleanExpressions} - \ref{bitwiseExpressions}, \ref{operatorPrecede nce}: Increased precedence of bitwise operations to be higher than equality and relational expressions. |
493 | 493 |
494 \ref{identifierReference}: Clarified static type rules. Type promotion support a dded. | 494 \ref{identifierReference}: Clarified static type rules. Type promotion support a dded. |
495 | 495 |
496 \ref{typeTest}: Type promotion support added. | 496 \ref{typeTest}: Type promotion support added. |
497 | 497 |
498 \ref{if}: Type promotion support added. | 498 \ref{if}: Type promotion support added. |
499 | 499 |
500 \ref{return}: Added warning if \RETURN{} without expression mixed with \RETURN{} with an expression. | 500 \ref{return}: Added warning if \RETURN{} without expression mixed with \RETURN{} with an expression. |
501 | 501 |
502 \ref{exports}: Ensure that exports treat \code{dart:} libs specially, like impor ts do. | |
503 | |
502 \ref{typePromotion}: Added notion of type promotion. | 504 \ref{typePromotion}: Added notion of type promotion. |
503 | 505 |
504 \ref{typedef}: Banned all recursion in typedefs. | 506 \ref{typedef}: Banned all recursion in typedefs. |
505 | 507 |
506 | 508 |
507 \section{Notation} | 509 \section{Notation} |
508 \label{notation} | 510 \label{notation} |
509 | 511 |
510 We distinguish between normative and non-normative text. Normative text defines the rules of Dart. It is given in this font. At this time, non-normative text in cludes: | 512 We distinguish between normative and non-normative text. Normative text defines the rules of Dart. It is given in this font. At this time, non-normative text in cludes: |
511 \begin{itemize} | 513 \begin{itemize} |
(...skipping 4771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5283 | 5285 |
5284 Then, for each entry mapping key $k$ to declaration $d$ in $NS$, $d$ is made av ailable in the top level scope of $L$ under the name $k$ unless either: | 5286 Then, for each entry mapping key $k$ to declaration $d$ in $NS$, $d$ is made av ailable in the top level scope of $L$ under the name $k$ unless either: |
5285 \begin{itemize} | 5287 \begin{itemize} |
5286 \item | 5288 \item |
5287 a top-level declaration with the name $k$ exists in $L$, OR | 5289 a top-level declaration with the name $k$ exists in $L$, OR |
5288 \item a prefix clause of the form \AS{} $k$ is used in $L$. | 5290 \item a prefix clause of the form \AS{} $k$ is used in $L$. |
5289 \end{itemize} | 5291 \end{itemize} |
5290 | 5292 |
5291 \rationale{The greatly increases the chance that a member can be added to a libr ary without breaking its importers.} | 5293 \rationale{The greatly increases the chance that a member can be added to a libr ary without breaking its importers.} |
5292 | 5294 |
5293 If a name $N$ is referenced by a library $L$ and $N$ would be introduced into th e top level scope $L$ by an import from a library whose name begins with \code{d art:} and an import from a library whose name does not begin with \code{dart:}: | 5295 If a name $N$ is referenced by a library $L$ and $N$ would be introduced into th e top level scope of $L$ by an import from a library whose URI begins with \code {dart:} and an import from a library whose name does not begin with \code{dart:} : |
ahe
2013/10/11 05:21:03
This sentence contains another use of "name" that
gbracha
2013/10/11 19:13:42
Done.
| |
5294 \begin{itemize} | 5296 \begin{itemize} |
5295 \item The import from \code{dart:} is implicitly extended by a \code{\HIDE{} $N$ } clause. | 5297 \item The import from \code{dart:} is implicitly extended by a \code{\HIDE{} $N$ } clause. |
5296 \item A static warning is issued. | 5298 \item A static warning is issued. |
5297 \end{itemize} | 5299 \end{itemize} |
5298 | 5300 |
5299 \rationale { | 5301 \rationale { |
5300 Whereas normal conflicts are resolved at deployment time, the functionality of \ code{dart:} libraries is injected into an application at run time, and may vary over time as browsers are upgraded. Thus, conflicts with \code{dart:} libraries can arise at runtime, outside the developerÕs control. To avoid breaking deploy ed applications in this way, conflicts with the \code{dart:} libraries are treat ed specially. | 5302 Whereas normal conflicts are resolved at deployment time, the functionality of \ code{dart:} libraries is injected into an application at run time, and may vary over time as browsers are upgraded. Thus, conflicts with \code{dart:} libraries can arise at runtime, outside the developerÕs control. To avoid breaking deploy ed applications in this way, conflicts with the \code{dart:} libraries are treat ed specially. |
5301 | 5303 |
5302 It is recommended that tools that deploy Dart code produce output in which all i mports use show clauses to ensure that additions to the namespace of a library n ever impact deployed code. | 5304 It is recommended that tools that deploy Dart code produce output in which all i mports use show clauses to ensure that additions to the namespace of a library n ever impact deployed code. |
5303 } | 5305 } |
5304 | 5306 |
5305 If a name $N$ is referenced by a library $L$ and $N$ is introduced into the to p level scope $L$ by more than one import, and not all the imports denote the sa me declaration, then: | 5307 If a name $N$ is referenced by a library $L$ and $N$ is introduced into the to p level scope of $L$ by more than one import, and not all the imports denote the same declaration, then: |
5306 \begin{itemize} | 5308 \begin{itemize} |
5307 \item A static warning occurs. | 5309 \item A static warning occurs. |
5308 \item If $N$ is referenced as a function, getter or setter, a \code{NoSuchMethod Error} is raised. | 5310 \item If $N$ is referenced as a function, getter or setter, a \code{NoSuchMethod Error} is raised. |
5309 \item If $N$ is referenced as a type, it is treated as a malformed type. | 5311 \item If $N$ is referenced as a type, it is treated as a malformed type. |
5310 | 5312 |
5311 \end{itemize} | 5313 \end{itemize} |
5312 | 5314 |
5313 We say that the namespace $NS$ {\em has been imported into} $L$. | 5315 We say that the namespace $NS$ {\em has been imported into} $L$. |
5314 | 5316 |
5315 \commentary{ | 5317 \commentary{ |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5383 \begin{itemize} | 5385 \begin{itemize} |
5384 \item If $C_i$ is of the form \code{\SHOW{} $id_1, \ldots, id_k$} then let | 5386 \item If $C_i$ is of the form \code{\SHOW{} $id_1, \ldots, id_k$} then let |
5385 | 5387 |
5386 $NS_i = \SHOW{}([id_1, \ldots, id_k], NS_{i-1}$). | 5388 $NS_i = \SHOW{}([id_1, \ldots, id_k], NS_{i-1}$). |
5387 \item If $C_i$ is of the form \code{\HIDE{} $id_1, \ldots, id_k$} | 5389 \item If $C_i$ is of the form \code{\HIDE{} $id_1, \ldots, id_k$} |
5388 | 5390 |
5389 then let $NS_i = \HIDE{}([id_1, \ldots, id_k], NS_{i-1}$). | 5391 then let $NS_i = \HIDE{}([id_1, \ldots, id_k], NS_{i-1}$). |
5390 \end{itemize} | 5392 \end{itemize} |
5391 | 5393 |
5392 For each | 5394 For each |
5393 entry mapping key $k$ to declaration $d$ in $NS_n$ an entry mapping $k$ to $d$ i s added to the exported namespace of $L$ unless a top-level declaration with th e name $k$ exists in $L$. We say that $L$ {\em re-exports library } $B$, and al so that $L$ {\em re-exports namespace } $NS_n$. When no confusion can arise, we may simply state that $L$ {\em re-exports }$B$, or that $L$ {\em re-exports }$NS _n$. | 5395 entry mapping key $k$ to declaration $d$ in $NS_n$ an entry mapping $k$ to $d$ i s added to the exported namespace of $L$ unless a top-level declaration with th e name $k$ exists in $L$. |
5396 | |
5397 If a name $N$ is referenced by a library $L$ and $N$ would be introduced into th e exported namespace of $L$ by an export from a library whose URI begins with \c ode{dart:} and an export from a library whose name does not begin with \code{dar t:}: | |
ahe
2013/10/11 05:21:03
Ditto.
gbracha
2013/10/11 19:13:42
Done.
| |
5398 \begin{itemize} | |
5399 \item The export from \code{dart:} is implicitly extended by a \code{\HIDE{} $N$ } clause. | |
5400 \item A static warning is issued. | |
5401 \end{itemize} | |
5402 | |
5403 \rationale{ | |
5404 See the discussion in section \ref{imports} for the reasoning behind this rule. | |
5405 } | |
5406 | |
5407 We say that $L$ {\em re-exports library } $B$, and also that $L$ {\em re-exports namespace } $NS_n$. When no confusion can arise, we may simply state that $L$ { \em re-exports }$B$, or that $L$ {\em re-exports }$NS_n$. | |
5394 | 5408 |
5395 It is a compile-time error if a name $N$ is re-exported by a library $L$ and $N$ is introduced into the export namespace of $L$ by more than one export, unless each all exports refer to same declaration for the name $N$. It is a static wa rning to export two different libraries with the same name. | 5409 It is a compile-time error if a name $N$ is re-exported by a library $L$ and $N$ is introduced into the export namespace of $L$ by more than one export, unless each all exports refer to same declaration for the name $N$. It is a static wa rning to export two different libraries with the same name. |
5396 | 5410 |
5397 | 5411 |
5398 | 5412 |
5399 \subsection{Parts} | 5413 \subsection{Parts} |
5400 \label{parts} | 5414 \label{parts} |
5401 | 5415 |
5402 A library may be divided into {\em parts}, each of which can be stored in a sepa rate location. A library identifies its parts by listing them via \PART{} direct ives. | 5416 A library may be divided into {\em parts}, each of which can be stored in a sepa rate location. A library identifies its parts by listing them via \PART{} direct ives. |
5403 | 5417 |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6086 \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. | 6100 \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. |
6087 \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 | 6101 \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 |
6088 \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. | 6102 \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. |
6089 \item The names of type variables are short (preferably single letter). Examples : T, S, K, V , E. | 6103 \item The names of type variables are short (preferably single letter). Examples : T, S, K, V , E. |
6090 \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. | 6104 \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. |
6091 \end{itemize} | 6105 \end{itemize} |
6092 } | 6106 } |
6093 | 6107 |
6094 | 6108 |
6095 \end{document} | 6109 \end{document} |
OLD | NEW |