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.11}} | 8 {\large Version 1.2}} |
9 \author{The Dart Team} | 9 \author{The Dart Team} |
10 \begin{document} | 10 \begin{document} |
11 \maketitle | 11 \maketitle |
12 | 12 |
13 \tableofcontents | 13 \tableofcontents |
14 | 14 |
15 | 15 |
16 \newpage | 16 \newpage |
17 | 17 |
18 \pagestyle{myheadings} | 18 \pagestyle{myheadings} |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
209 \subsection{Privacy} | 209 \subsection{Privacy} |
210 \label{privacy} | 210 \label{privacy} |
211 | 211 |
212 Dart supports two levels of privacy: {\em public} and {\em private}. A declarati on is {\em private} iff its name begins with an underscore (the \_ character) ot herwise it is {\em public.} | 212 Dart supports two levels of privacy: {\em public} and {\em private}. A declarati on is {\em private} iff its name begins with an underscore (the \_ character) ot herwise it is {\em public.} |
213 A declaration $m$ is {\em accessible to library $L$} if $m$ is declared in $L$ or if $m$ is public. | 213 A declaration $m$ is {\em accessible to library $L$} if $m$ is declared in $L$ or if $m$ is public. |
214 | 214 |
215 \commentary{ | 215 \commentary{ |
216 This means private declarations may only be accessed within the library in which they are declared. | 216 This means private declarations may only be accessed within the library in which they are declared. |
217 } | 217 } |
218 | 218 |
219 Privacy applies only to declarations within a library, not to library declaratio ns themselves. | |
220 | |
221 \rationale{ | |
222 Libraries do not reference each other by name and so the idea of a private libra ry is meaningless. | |
223 Thus, if the name of a library begins with an underscore, it has no special sign ificance. | |
224 } | |
225 | 219 |
Lasse Reichstein Nielsen
2014/02/14 11:48:26
With this change, a library name declaration is pr
| |
226 \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. | 220 \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. |
227 | 221 |
228 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.} | 222 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.} |
229 | 223 |
230 \subsection{Concurrency} | 224 \subsection{Concurrency} |
231 | 225 |
232 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}. | 226 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}. |
233 | 227 |
234 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}). | 228 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}). |
235 | 229 |
(...skipping 4589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4825 | 4819 |
4826 %\end{dartCode} | 4820 %\end{dartCode} |
4827 | 4821 |
4828 %\rationale{therefore, we opt for the second option. Alternately, one could insi st that assert be a reserved word, which may have an undesirable effect with res pect to compatibility of Javascript code ported to Dart.} | 4822 %\rationale{therefore, we opt for the second option. Alternately, one could insi st that assert be a reserved word, which may have an undesirable effect with res pect to compatibility of Javascript code ported to Dart.} |
4829 | 4823 |
4830 \section{Libraries and Scripts} | 4824 \section{Libraries and Scripts} |
4831 \label{librariesAndScripts} | 4825 \label{librariesAndScripts} |
4832 | 4826 |
4833 A Dart program consists of one or more libraries, and may be built out of one or more {\em compilation units}. A compilation unit may be a library or a part (\r ef{parts}). | 4827 A Dart program consists of one or more libraries, and may be built out of one or more {\em compilation units}. A compilation unit may be a library or a part (\r ef{parts}). |
4834 | 4828 |
4835 A library consists of (a possibly empty) set of imports, a set of exports, and a set of top-level declarations. A top-level declaration is either a class (\ref{ classes}), a type alias declaration (\ref{typedef}), a function (\ref{functions} ) or a variable declaration (\ref{variables}). The members of a library $L$ are those top level declarations given within a $L$. | 4829 A library consists of (a possibly empty) set of imports, a set of exports, and a set of top-level declarations. A top-level declaration is either a class (\ref {classes}), a type alias declaration (\ref{typedef}), a function (\ref{functions }) or a variable declaration (\ref{variables}). The members of a library $L$ are those top level declarations given within a $L$. |
4836 | 4830 |
4837 \begin{grammar} | 4831 \begin{grammar} |
4838 {\bf topLevelDefinition:}classDefinition; | 4832 {\bf topLevelDefinition:}classDefinition; |
4839 % classDefinitionOrInterfaceInjection; | 4833 % classDefinitionOrInterfaceInjection; |
4840 % interfaceDefinitionOrInterfaceInjection; | 4834 % interfaceDefinitionOrInterfaceInjection; |
4841 % mixinApplication; | 4835 % mixinApplication; |
4842 typeAlias; | 4836 typeAlias; |
4843 \EXTERNAL{}? functionSignature `{\escapegrammar ;}'; | 4837 \EXTERNAL{}? functionSignature `{\escapegrammar ;}'; |
4844 \EXTERNAL{}? getterSignature `{\escapegrammar ;}'; | 4838 \EXTERNAL{}? getterSignature `{\escapegrammar ;}'; |
4845 \EXTERNAL{}? setterSignature `{\escapegrammar ;}'; | 4839 \EXTERNAL{}? setterSignature `{\escapegrammar ;}'; |
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5830 \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. | 5824 \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. |
5831 \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 | 5825 \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 |
5832 \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. | 5826 \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. |
5833 \item The names of type variables are short (preferably single letter). Examples : T, S, K, V , E. | 5827 \item The names of type variables are short (preferably single letter). Examples : T, S, K, V , E. |
5834 \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. | 5828 \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. |
5835 \end{itemize} | 5829 \end{itemize} |
5836 } | 5830 } |
5837 | 5831 |
5838 | 5832 |
5839 \end{document} | 5833 \end{document} |
OLD | NEW |