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

Unified Diff: docs/language/dartLangSpec.tex

Issue 140743006: Clarified use of const in for-in loop is illegal. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: docs/language/dartLangSpec.tex
===================================================================
--- docs/language/dartLangSpec.tex (revision 31896)
+++ docs/language/dartLangSpec.tex (working copy)
@@ -5,7 +5,7 @@
\usepackage{hyperref}
\newcommand{\code}[1]{{\sf #1}}
\title{Dart Programming Language Specification \\
-{\large Version 1.1}}
+{\large Version 1.11}}
\author{The Dart Team}
\begin{document}
\maketitle
@@ -3114,7 +3114,7 @@
A function expression invocation $e_f(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ is equivalent to $e_f.call(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$.
\commentary{
-The implication of this definition, and the other definitions involving the method \code{call()}, is that user defined types can be used as function values provided they define a \code{call()} method. The method \code{call()} is special in this regard. The signature of the \code{call()} method determines the signature used when using the object via the built-in invocation syntax.
+The implication of this definition, and the other definitions involving the method \code{call()}, is that user defined types can be used as function values provided 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 the object via the built-in invocation syntax.
}
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 \DYNAMIC{}. Otherwise
@@ -4312,16 +4312,20 @@
\subsubsection{For-in}
\label{for-in}
-A for statement of the form \code{ \FOR{} ($varOrType?$ id \IN{} $e$) $s$} is equivalent to the following code:
+A for statement of the form \code{ \FOR{} ($finalConstVarOrType?$ id \IN{} $e$) $s$} is equivalent to the following code:
\begin{dartCode}
var n0 = $e$.iterator;
\WHILE{} (n0.moveNext()) \{
- $varOrType?$ id = n0.current;
+ $finalConstVarOrType?$ id = n0.current;
$s$
\}
\end{dartCode}
where \code{n0} is an identifier that does not occur anywhere in the program.
+
+\commentary{
+Note that in fact, using a \CONST{} variable would give rise to a compile time error since \cd{n0.current} is not a constant expression.
+}
\subsection{While}
\label{while}
« 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