Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(625)

Side by Side Diff: docs/language/dartLangSpec.tex

Issue 280473004: main function may take two arguments. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5205 matching lines...) Expand 10 before | Expand all | Expand 10 after
5216 A {\em part header} begins with \PART{} \OF{} followed by the name of the libr ary the part belongs to. A part declaration consists of a part header followed by a sequence of top-level declarations. 5216 A {\em part header} begins with \PART{} \OF{} followed by the name of the libr ary the part belongs to. A part declaration consists of a part header followed by a sequence of top-level declarations.
5217 5217
5218 Compiling a part directive of the form \code{\PART{} $s$;} causes the Dart syste m to attempt to compile the contents of the URI that is the value of $s$. The to p-level declarations at that URI are then compiled by the Dart compiler in the s cope of the current library. It is a compile-time error if the contents of the U RI are not a valid part declaration. It is a static warning if the referenced pa rt declaration $p$ names a library other than the current library as the library to which $p$ belongs. 5218 Compiling a part directive of the form \code{\PART{} $s$;} causes the Dart syste m to attempt to compile the contents of the URI that is the value of $s$. The to p-level declarations at that URI are then compiled by the Dart compiler in the s cope of the current library. It is a compile-time error if the contents of the U RI are not a valid part declaration. It is a static warning if the referenced pa rt declaration $p$ names a library other than the current library as the library to which $p$ belongs.
5219 5219
5220 \subsection{Scripts} 5220 \subsection{Scripts}
5221 \label{scripts} 5221 \label{scripts}
5222 5222
5223 A {\em script} is a library whose exported namespace (\ref{exports}) includes a top-level function \code{main}. 5223 A {\em script} is a library whose exported namespace (\ref{exports}) includes a top-level function \code{main}.
5224 A script $S$ may be executed as follows: 5224 A script $S$ may be executed as follows:
5225 5225
5226 First, $S$ is compiled as a library as specified above. Then, the top-level func tion \code{main} that is in the exported namespace of $S$ is invoked. If \code{m ain} has no formal parameters, it is invoked with no arguments. Otherwise \code{ main} is invoked with a single actual argument whose type implements \code{List$ <$String$>$}. It is a run time error if $S$ does not declare or import a top-lev el function \code{main}. It is a static warning if \code{main} has more than one required parameter. 5226 First, $S$ is compiled as a library as specified above. Then, the top-level func tion \code{main} that is in the exported namespace of $S$ is invoked. If \code{m ain} has no positional parameters, it is invoked with no arguments. Otherwise if \code{main} has exactly one positional parameter, it is invoked with a single a ctual argument whose runtime type implements \code{List$<$String$>$}. Otherwise \code{main} is invoked with the following two actual arguments:
5227 \begin{enumerate}
5228 \item An object whose runtime type implements \code{List$<$String$>$}.
5229 \item The initial message of the current isolate $i$ as determined by the invoca tion of \code{Isolate.spawnUri} that spawned $i$.
5230 \end{enumerate}
5231
5232 It is a run time error if $S$ does not declare or import a top-level function \c ode{main}. It is a static warning if \code{main} has more than two required para meters.
5227 5233
5228 \commentary { 5234 \commentary {
5229 If \code{main} requires more than one argument, a run time error will occur. 5235 Note that if \code{main} requires more than two arguments, a run time error will occur.
5230 } 5236 }
5231 5237
5232 \rationale{ 5238 \rationale{
5233 The names of scripts are optional, in the interests of interactive, informal use . However, any script of long term value should be given a name as a matter of g ood practice. 5239 The names of scripts are optional, in the interests of interactive, informal use . However, any script of long term value should be given a name as a matter of g ood practice.
5234 } 5240 }
5235 5241
5236 \commentary { 5242 \commentary {
5237 A Dart program will typically be executed by executing a script. 5243 A Dart program will typically be executed by executing a script.
5238 } 5244 }
5239 5245
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
5931 \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. 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.
5932 \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 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
5933 \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. 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.
5934 \item The names of type variables are short (preferably single letter). Examples : T, S, K, V , E. 5940 \item The names of type variables are short (preferably single letter). Examples : T, S, K, V , E.
5935 \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. 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.
5936 \end{itemize} 5942 \end{itemize}
5937 } 5943 }
5938 5944
5939 5945
5940 \end{document} 5946 \end{document}
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698