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

Unified Diff: docs/language/dartLangSpec.tex

Issue 1181733003: Specify behavior of e?.v++ and e?.v-- (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix Makefile Created 5 years, 6 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 | « docs/language/Makefile ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: docs/language/dartLangSpec.tex
diff --git a/docs/language/dartLangSpec.tex b/docs/language/dartLangSpec.tex
index c0b9cff01ea5ff6531cd28400c2b787e7128cc2e..400a511c63742e383ef9baaf3d335308d2296e5f 100644
--- a/docs/language/dartLangSpec.tex
+++ b/docs/language/dartLangSpec.tex
@@ -5012,47 +5012,56 @@ Postfix expressions invoke the postfix operators on objects.
A {\em postfix expression} is either a primary expression, a function, method or getter invocation, or an invocation of a postfix operator on an expression $e$.
\LMHash{}
-A postfix expression of the form \code{$v$++}, where $v$ is an identifier, is equivalent to \code{()\{var r = $v$; $v$ = r + 1; return r\}()}.
+A postfix expression of the form \code{$v$++}, where $v$ is an identifier, is equivalent to \code{()\{\VAR{} r = $v$; $v$ = r + 1; \RETURN{} r\}()}.
\rationale{The above ensures that if $v$ is a field, the getter gets called exactly once. Likewise in the cases below.
}
-%what about e?.x++
\LMHash{}
A postfix expression of the form \code{$C.v$ ++} is equivalent to
-\code{()\{var r = $C.v$; $C.v$ = r + 1; return r\}()}.
+\code{()\{\VAR{} r = $C.v$; $C.v$ = r + 1; \RETURN{} r\}()}.
\LMHash{}
A postfix expression of the form \code{$e_1.v$++} is equivalent to
-\code{(x)\{var r = x.v; x.v = r + 1; \RETURN{} r\}($e_1$)}.
+\code{(x)\{\VAR{} r = x.v; x.v = r + 1; \RETURN{} r\}($e_1$)}.
\LMHash{}
A postfix expression of the form \code{$e_1[e_2]$++}, is equivalent to
-\code{(a, i)\{var r = a[i]; a[i] = r + 1; return r\}($e_1$, $e_2$)}.
+\code{(a, i)\{\VAR{} r = a[i]; a[i] = r + 1; \RETURN{} r\}($e_1$, $e_2$)}.
\LMHash{}
A postfix expression of the form \code{$v$-{}-}, where $v$ is an identifier, is equivalent to
-\code{()\{var r = $v$; $v$ = r - 1; return r\}()}.
+\code{()\{\VAR{} r = $v$; $v$ = r - 1; \RETURN{} r\}()}.
\LMHash{}
A postfix expression of the form \code{$C.v$-{}-} is equivalent to
-\code{()\{var r = $C.v$; $C.v$ = r - 1; return r\}()}.
+\code{()\{\VAR{} r = $C.v$; $C.v$ = r - 1; \RETURN{} r\}()}.
\LMHash{}
A postfix expression of the form \code{$e_1.v$-{}-} is equivalent to
-\code{(x)\{var r = x.v; x.v = r - 1; \RETURN{} r\}($e_1$)}.
+\code{(x)\{\VAR{} r = x.v; x.v = r - 1; \RETURN{} r\}($e_1$)}.
\LMHash{}
A postfix expression of the form \code{$e_1[e_2]$-{}-}, is equivalent to
-\code{(a, i)\{var r = a[i]; a[i] = r - 1; return r\}($e_1$, $e_2$)}.
-
+\code{(a, i)\{\VAR{} r = a[i]; a[i] = r - 1; \RETURN{} r\}($e_1$, $e_2$)}.
+
+\LMHash{}
+A postfix expression of the form \code{$e_1?.v$++} is equivalent to
+
+\code{((x) =$>$ x == \NULL? \NULL : x.v++)($e_1$)}.
+
+\LMHash{}
+A postfix expression of the form \code{$e_1?.v$-{}-} is equivalent to
+
+\code{((x) =$>$ x == \NULL? \NULL : x.v-{}-)($e_1$)}.
+
\subsection{ Assignable Expressions}
\LMLabel{assignableExpressions}
« no previous file with comments | « docs/language/Makefile ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698