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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « docs/language/Makefile ('k') | 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{color} 3 \usepackage{color}
4 \usepackage{dart} 4 \usepackage{dart}
5 \usepackage{bnf} 5 \usepackage{bnf}
6 \usepackage{hyperref} 6 \usepackage{hyperref}
7 \usepackage{lmodern} 7 \usepackage{lmodern}
8 \newcommand{\code}[1]{{\sf #1}} 8 \newcommand{\code}[1]{{\sf #1}}
9 \title{Dart Programming Language Specification \\ 9 \title{Dart Programming Language Specification \\
10 {\large Version 1.10}} 10 {\large Version 1.10}}
(...skipping 4994 matching lines...) Expand 10 before | Expand all | Expand 10 after
5005 {\bf incrementOperator:}`++'; 5005 {\bf incrementOperator:}`++';
5006 `-{}-' 5006 `-{}-'
5007 . 5007 .
5008 5008
5009 \end{grammar} 5009 \end{grammar}
5010 5010
5011 \LMHash{} 5011 \LMHash{}
5012 A {\em postfix expression} is either a primary expression, a function, method o r getter invocation, or an invocation of a postfix operator on an expression $e$ . 5012 A {\em postfix expression} is either a primary expression, a function, method o r getter invocation, or an invocation of a postfix operator on an expression $e$ .
5013 5013
5014 \LMHash{} 5014 \LMHash{}
5015 A postfix expression of the form \code{$v$++}, where $v$ is an identifier, is eq uivalent to \code{()\{var r = $v$; $v$ = r + 1; return r\}()}. 5015 A postfix expression of the form \code{$v$++}, where $v$ is an identifier, is eq uivalent to \code{()\{\VAR{} r = $v$; $v$ = r + 1; \RETURN{} r\}()}.
5016 5016
5017 \rationale{The above ensures that if $v$ is a field, the getter gets called exac tly once. Likewise in the cases below. 5017 \rationale{The above ensures that if $v$ is a field, the getter gets called exac tly once. Likewise in the cases below.
5018 } 5018 }
5019 %what about e?.x++
5020 5019
5021 \LMHash{} 5020 \LMHash{}
5022 A postfix expression of the form \code{$C.v$ ++} is equivalent to 5021 A postfix expression of the form \code{$C.v$ ++} is equivalent to
5023 5022
5024 \code{()\{var r = $C.v$; $C.v$ = r + 1; return r\}()}. 5023 \code{()\{\VAR{} r = $C.v$; $C.v$ = r + 1; \RETURN{} r\}()}.
5025 5024
5026 \LMHash{} 5025 \LMHash{}
5027 A postfix expression of the form \code{$e_1.v$++} is equivalent to 5026 A postfix expression of the form \code{$e_1.v$++} is equivalent to
5028 5027
5029 \code{(x)\{var r = x.v; x.v = r + 1; \RETURN{} r\}($e_1$)}. 5028 \code{(x)\{\VAR{} r = x.v; x.v = r + 1; \RETURN{} r\}($e_1$)}.
5030 5029
5031 \LMHash{} 5030 \LMHash{}
5032 A postfix expression of the form \code{$e_1[e_2]$++}, is equivalent to 5031 A postfix expression of the form \code{$e_1[e_2]$++}, is equivalent to
5033 5032
5034 \code{(a, i)\{var r = a[i]; a[i] = r + 1; return r\}($e_1$, $e_2$)}. 5033 \code{(a, i)\{\VAR{} r = a[i]; a[i] = r + 1; \RETURN{} r\}($e_1$, $e_2$)}.
5035 5034
5036 \LMHash{} 5035 \LMHash{}
5037 A postfix expression of the form \code{$v$-{}-}, where $v$ is an identifier, is equivalent to 5036 A postfix expression of the form \code{$v$-{}-}, where $v$ is an identifier, is equivalent to
5038 5037
5039 \code{()\{var r = $v$; $v$ = r - 1; return r\}()}. 5038 \code{()\{\VAR{} r = $v$; $v$ = r - 1; \RETURN{} r\}()}.
5040 5039
5041 \LMHash{} 5040 \LMHash{}
5042 A postfix expression of the form \code{$C.v$-{}-} is equivalent to 5041 A postfix expression of the form \code{$C.v$-{}-} is equivalent to
5043 5042
5044 \code{()\{var r = $C.v$; $C.v$ = r - 1; return r\}()}. 5043 \code{()\{\VAR{} r = $C.v$; $C.v$ = r - 1; \RETURN{} r\}()}.
5045 5044
5046 \LMHash{} 5045 \LMHash{}
5047 A postfix expression of the form \code{$e_1.v$-{}-} is equivalent to 5046 A postfix expression of the form \code{$e_1.v$-{}-} is equivalent to
5048 5047
5049 \code{(x)\{var r = x.v; x.v = r - 1; \RETURN{} r\}($e_1$)}. 5048 \code{(x)\{\VAR{} r = x.v; x.v = r - 1; \RETURN{} r\}($e_1$)}.
5050 5049
5051 \LMHash{} 5050 \LMHash{}
5052 A postfix expression of the form \code{$e_1[e_2]$-{}-}, is equivalent to 5051 A postfix expression of the form \code{$e_1[e_2]$-{}-}, is equivalent to
5053 5052
5054 \code{(a, i)\{var r = a[i]; a[i] = r - 1; return r\}($e_1$, $e_2$)}. 5053 \code{(a, i)\{\VAR{} r = a[i]; a[i] = r - 1; \RETURN{} r\}($e_1$, $e_2$)}.
5055 5054
5055 \LMHash{}
5056 A postfix expression of the form \code{$e_1?.v$++} is equivalent to
5057
5058 \code{((x) =$>$ x == \NULL? \NULL : x.v++)($e_1$)}.
5059
5060 \LMHash{}
5061 A postfix expression of the form \code{$e_1?.v$-{}-} is equivalent to
5062
5063 \code{((x) =$>$ x == \NULL? \NULL : x.v-{}-)($e_1$)}.
5064
5056 5065
5057 \subsection{ Assignable Expressions} 5066 \subsection{ Assignable Expressions}
5058 \LMLabel{assignableExpressions} 5067 \LMLabel{assignableExpressions}
5059 5068
5060 \LMHash{} 5069 \LMHash{}
5061 Assignable expressions are expressions that can appear on the left hand side of an assignment. 5070 Assignable expressions are expressions that can appear on the left hand side of an assignment.
5062 This section describes how to evaluate these expressions when they do not consti tute the complete left hand side of an assignment. 5071 This section describes how to evaluate these expressions when they do not consti tute the complete left hand side of an assignment.
5063 5072
5064 \rationale{ 5073 \rationale{
5065 Of course, if assignable expressions always appeared {\em as} the left hand side , one would have no need for their value, and the rules for evaluating them woul d be unnecessary. However, assignable expressions can be subexpressions of othe r expressions and therefore must be evaluated. 5074 Of course, if assignable expressions always appeared {\em as} the left hand side , one would have no need for their value, and the rules for evaluating them woul d be unnecessary. However, assignable expressions can be subexpressions of othe r expressions and therefore must be evaluated.
(...skipping 2731 matching lines...) Expand 10 before | Expand all | Expand 10 after
7797 7806
7798 The invariant that each normative paragraph is associated with a line 7807 The invariant that each normative paragraph is associated with a line
7799 containing the text \LMHash{} should be maintained. Extra occurrences 7808 containing the text \LMHash{} should be maintained. Extra occurrences
7800 of \LMHash{} can be added if needed, e.g., in order to make 7809 of \LMHash{} can be added if needed, e.g., in order to make
7801 individual \item{}s in itemized lists addressable. Each \LM.. command 7810 individual \item{}s in itemized lists addressable. Each \LM.. command
7802 must occur on a separate line. \LMHash{} must occur immediately 7811 must occur on a separate line. \LMHash{} must occur immediately
7803 before the associated paragraph, and \LMLabel must occur immediately 7812 before the associated paragraph, and \LMLabel must occur immediately
7804 after the associated \section{}, \subsection{} etc. 7813 after the associated \section{}, \subsection{} etc.
7805 7814
7806 ---------------------------------------------------------------------- 7815 ----------------------------------------------------------------------
OLDNEW
« 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