OLD | NEW |
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 {4th edition draft}\\ | 10 {4th edition draft}\\ |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 %\end{grammar} | 734 %\end{grammar} |
735 | 735 |
736 \subsubsection{Optional Formals} | 736 \subsubsection{Optional Formals} |
737 \LMLabel{optionalFormals} | 737 \LMLabel{optionalFormals} |
738 | 738 |
739 \LMHash{} | 739 \LMHash{} |
740 Optional parameters may be specified and provided with default values. | 740 Optional parameters may be specified and provided with default values. |
741 | 741 |
742 \begin{grammar} | 742 \begin{grammar} |
743 {\bf defaultFormalParameter:} | 743 {\bf defaultFormalParameter:} |
744 normalFormalParameter ('=' expression)? | 744 normalFormalParameter (`=' expression)? |
745 . | 745 . |
746 | 746 |
747 {\bf defaultNamedParameter:} | 747 {\bf defaultNamedParameter:}normalFormalParameter (`=' expression)?; |
748 normalFormalParameter ( `{\escapegrammar :}' expression)? | 748 normalFormalParameter ( `{\escapegrammar :}' expression)? |
749 . | 749 . |
750 \end{grammar} | 750 \end{grammar} |
751 | 751 |
| 752 A {\bf defaultNamedParameter} on the form: |
| 753 \begin{code} |
| 754 normalFormalParameter : expression |
| 755 \end{code} |
| 756 is equivalent to one on the form: |
| 757 \begin{code} |
| 758 normalFormalParameter = expression |
| 759 \end{code} |
| 760 The colon-syntax is included only for backwards compatibility. |
| 761 It is deprecated and will be removed in a later version of the language specific
ation. |
| 762 |
752 \LMHash{} | 763 \LMHash{} |
753 It is a compile-time error if the default value of an optional parameter is not
a compile-time constant (\ref{constants}). If no default is explicitly specified
for an optional parameter an implicit default of \NULL{} is provided. | 764 It is a compile-time error if the default value of an optional parameter is not
a compile-time constant (\ref{constants}). If no default is explicitly specified
for an optional parameter an implicit default of \NULL{} is provided. |
754 | 765 |
755 \LMHash{} | 766 \LMHash{} |
756 It is a compile-time error if the name of a named optional parameter begins with
an `\_' character. | 767 It is a compile-time error if the name of a named optional parameter begins with
an `\_' character. |
757 | 768 |
758 \rationale{ | 769 \rationale{ |
759 The need for this restriction is a direct consequence of the fact that naming a
nd privacy are not orthogonal. | 770 The need for this restriction is a direct consequence of the fact that naming a
nd privacy are not orthogonal. |
760 If we allowed named parameters to begin with an underscore, they would be consid
ered private and inaccessible to callers from outside the library where it was d
efined. If a method outside the library overrode a method with a private optiona
l name, it would not be a subtype of the original method. The static checker wou
ld of course flag such situations, but the consequence would be that adding a pr
ivate named formal would break clients outside the library in a way they could n
ot easily correct. | 771 If we allowed named parameters to begin with an underscore, they would be consid
ered private and inaccessible to callers from outside the library where it was d
efined. If a method outside the library overrode a method with a private optiona
l name, it would not be a subtype of the original method. The static checker wou
ld of course flag such situations, but the consequence would be that adding a pr
ivate named formal would break clients outside the library in a way they could n
ot easily correct. |
761 } | 772 } |
(...skipping 2381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3143 \cd{\CLASS{} C$<$T$>$ \IMPLEMENTS{} Future$<$C$<$C$<$T$>>>$ \ldots } | 3154 \cd{\CLASS{} C$<$T$>$ \IMPLEMENTS{} Future$<$C$<$C$<$T$>>>$ \ldots } |
3144 | 3155 |
3145 Here, a naive definition of $flatten$ diverges; there is not even a fixed point.
A more sophisticated definition of $flatten$ is possible, but the existing rule
deals with most realistic examples while remaining relatively simple to underst
and. | 3156 Here, a naive definition of $flatten$ diverges; there is not even a fixed point.
A more sophisticated definition of $flatten$ is possible, but the existing rule
deals with most realistic examples while remaining relatively simple to underst
and. |
3146 | 3157 |
3147 } | 3158 } |
3148 | 3159 |
3149 | 3160 |
3150 \LMHash{} | 3161 \LMHash{} |
3151 The static type of a function literal of the form | 3162 The static type of a function literal of the form |
3152 | 3163 |
3153 $(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots, T_{n+k}$ $x_
{n+k} : d_k\}) => e$ | 3164 $(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} = d_1, \ldots, T_{n+k}$ $x_
{n+k} = d_k\}) => e$ |
3154 is | 3165 is |
3155 | 3166 |
3156 $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightarrow
T_0$, where $T_0$ is the static type of $e$. | 3167 $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightarrow
T_0$, where $T_0$ is the static type of $e$. |
3157 | 3168 |
3158 \LMHash{} | 3169 \LMHash{} |
3159 The static type of a function literal of the form | 3170 The static type of a function literal of the form |
3160 | 3171 |
3161 $(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots, T_{n+k}$ $x_
{n+k} : d_k\})$ \ASYNC{} $=> e$ | 3172 $(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} = d_1, \ldots, T_{n+k}$ $x_
{n+k} = d_k\})$ \ASYNC{} $=> e$ |
3162 | 3173 |
3163 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightar
row Future<flatten(T_0)>$, where $T_0$ is the static type of $e$. | 3174 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightar
row Future<flatten(T_0)>$, where $T_0$ is the static type of $e$. |
3164 | 3175 |
3165 \LMHash{} | 3176 \LMHash{} |
3166 The static type of a function literal of the form | 3177 The static type of a function literal of the form |
3167 | 3178 |
3168 $(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots, T_{n+k}$ $x_{
n+k}= d_k])\{s\}$ | 3179 $(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots, T_{n+k}$ $x_{
n+k}= d_k])\{s\}$ |
3169 | 3180 |
3170 is $(T_1 \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \rightarro
w \DYNAMIC{}$. | 3181 is $(T_1 \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \rightarro
w \DYNAMIC{}$. |
3171 | 3182 |
(...skipping 20 matching lines...) Expand all Loading... |
3192 The static type of a function literal of the form | 3203 The static type of a function literal of the form |
3193 | 3204 |
3194 $(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots, T_{n+k}$ $x_{
n+k}= d_k])\{s\}$ | 3205 $(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots, T_{n+k}$ $x_{
n+k}= d_k])\{s\}$ |
3195 | 3206 |
3196 is $(T_1 \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \rightarro
w \DYNAMIC{}$. | 3207 is $(T_1 \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \rightarro
w \DYNAMIC{}$. |
3197 | 3208 |
3198 | 3209 |
3199 \LMHash{} | 3210 \LMHash{} |
3200 The static type of a function literal of the form | 3211 The static type of a function literal of the form |
3201 | 3212 |
3202 $(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots, T_{n+k}$ $x_
{n+k} : d_k\})$ $\ASYNC{}$ $\{s\}$ | 3213 $(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} = d_1, \ldots, T_{n+k}$ $x_
{n+k} = d_k\})$ $\ASYNC{}$ $\{s\}$ |
3203 | 3214 |
3204 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightar
row Future{}$. | 3215 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightar
row Future{}$. |
3205 | 3216 |
3206 \LMHash{} | 3217 \LMHash{} |
3207 The static type of a function literal of the form | 3218 The static type of a function literal of the form |
3208 | 3219 |
3209 $(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots, T_{n+k}$ $x_
{n+k} : d_k\})$ $\ASYNC*{}$ $\{s\}$ | 3220 $(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} = d_1, \ldots, T_{n+k}$ $x_
{n+k} = d_k\})$ $\ASYNC*{}$ $\{s\}$ |
3210 | 3221 |
3211 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightar
row Stream{}$. | 3222 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightar
row Stream{}$. |
3212 | 3223 |
3213 \LMHash{} | 3224 \LMHash{} |
3214 The static type of a function literal of the form | 3225 The static type of a function literal of the form |
3215 | 3226 |
3216 $(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots, T_{n+k}$ $x_
{n+k} : d_k\})$ $\SYNC*{}$ $\{s\}$ | 3227 $(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} = d_1, \ldots, T_{n+k}$ $x_
{n+k} = d_k\})$ $\SYNC*{}$ $\{s\}$ |
3217 | 3228 |
3218 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightar
row Iterable{}$. | 3229 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightar
row Iterable{}$. |
3219 | 3230 |
3220 \LMHash{} | 3231 \LMHash{} |
3221 In all of the above cases, whenever $T_i, 1 \le i \le n+k$, is not specified, it
is considered to have been specified as \DYNAMIC{}. | 3232 In all of the above cases, whenever $T_i, 1 \le i \le n+k$, is not specified, it
is considered to have been specified as \DYNAMIC{}. |
3222 | 3233 |
3223 | 3234 |
3224 \subsection{ This} | 3235 \subsection{ This} |
3225 \LMLabel{this} | 3236 \LMLabel{this} |
3226 | 3237 |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3852 \LMHash{} | 3863 \LMHash{} |
3853 If $n < h$, or $n > m$, the method lookup has failed. Furthermore, each $x_i, n
+1 \le i \le n+k$, must have a corresponding named parameter in the set $\{p_{m
+1}, \ldots, p_{h+l}\}$ or the method lookup also fails. If $v_o$ is an instanc
e of \code{Type} but $o$ is not a constant type literal, then if $m$ is a method
that forwards (\ref{functionDeclarations}) to a static method, method lookup fa
ils. Otherwise method lookup has succeeded. | 3864 If $n < h$, or $n > m$, the method lookup has failed. Furthermore, each $x_i, n
+1 \le i \le n+k$, must have a corresponding named parameter in the set $\{p_{m
+1}, \ldots, p_{h+l}\}$ or the method lookup also fails. If $v_o$ is an instanc
e of \code{Type} but $o$ is not a constant type literal, then if $m$ is a method
that forwards (\ref{functionDeclarations}) to a static method, method lookup fa
ils. Otherwise method lookup has succeeded. |
3854 | 3865 |
3855 \LMHash{} | 3866 \LMHash{} |
3856 If the method lookup succeeded, the body of $f$ is executed with respect to the
bindings that resulted from the evaluation of the argument list, and with \THIS{
} bound to $v_o$. The value of $i$ is the value returned after $f$ is executed. | 3867 If the method lookup succeeded, the body of $f$ is executed with respect to the
bindings that resulted from the evaluation of the argument list, and with \THIS{
} bound to $v_o$. The value of $i$ is the value returned after $f$ is executed. |
3857 | 3868 |
3858 \LMHash{} | 3869 \LMHash{} |
3859 If the method lookup has failed, then let $g$ be the result of looking up getter
(\ref{getterAndSetterLookup}) $m$ in $v_o$ with respect to $L$. | 3870 If the method lookup has failed, then let $g$ be the result of looking up getter
(\ref{getterAndSetterLookup}) $m$ in $v_o$ with respect to $L$. |
3860 If $v_o$ is an instance of \code{Type} but $o$ is not a constant type literal, t
hen if $g$ is a getter that forwards to a static getter, getter lookup fails. | 3871 If $v_o$ is an instance of \code{Type} but $o$ is not a constant type literal, t
hen if $g$ is a getter that forwards to a static getter, getter lookup fails. |
3861 If the getter lookup succeeded, let $v_g$ be the value of the getter invocation
$o.m$. Then the value of $i$ is the result of invoking | 3872 If the getter lookup succeeded, let $v_g$ be the value of the getter invocation
$o.m$. Then the value of $i$ is the result of invoking |
3862 the static method \code{Function.apply()} with arguments $v.g, [o_1, \ldots , o_
n], \{x_{n+1}: o_{n+1}, \ldots , x_{n+k}: o_{n+k}\}$. | 3873 the static method \code{Function.apply()} with arguments $v.g, [o_1, \ldots , o_
n], \{\#x_{n+1}: o_{n+1}, \ldots , \#x_{n+k}: o_{n+k}\}$. |
3863 | 3874 |
3864 \LMHash{} | 3875 \LMHash{} |
3865 If getter lookup has also failed, then a new instance $im$ of the predefined c
lass \code{Invocation} is created, such that : | 3876 If getter lookup has also failed, then a new instance $im$ of the predefined cla
ss \code{Invocation} is created, such that: |
3866 \begin{itemize} | 3877 \begin{itemize} |
3867 \item \code{im.isMethod} evaluates to \code{\TRUE{}}. | 3878 \item \code{im.isMethod} evaluates to \code{\TRUE{}}. |
3868 \item \code{im.memberName} evaluates to the symbol \code{m}. | 3879 \item \code{im.memberName} evaluates to the symbol \code{m}. |
3869 \item \code{im.positionalArguments} evaluates to an immutable list with the same
values as \code{[$o_1, \ldots, o_n$]}. | 3880 \item \code{im.positionalArguments} evaluates to an immutable list with the same
values as \code{[$o_1, \ldots, o_n$]}. |
3870 \item \code{im.namedArguments} evaluates to an immutable map with the same keys
and values as \code{\{$x_{n+1}: o_{n+1}, \ldots, x_{n+k} : o_{n+k}$\}}. | 3881 \item \code{im.namedArguments} evaluates to an immutable map with the same keys
and values as \code{\{$\#x_{n+1}: o_{n+1}, \ldots, \#x_{n+k} : o_{n+k}$\}}. |
3871 \end{itemize} | 3882 \end{itemize} |
3872 | 3883 |
3873 \LMHash{} | 3884 \LMHash{} |
3874 Then the method \code{noSuchMethod()} is looked up in $v_o$ and invoked with arg
ument $im$, and the result of this invocation is the result of evaluating $i$. H
owever, if the implementation found cannot be invoked with a single positional a
rgument, the implementation of \code{noSuchMethod()} in class \code{Object} is
invoked on $v_o$ with argument $im'$, where $im'$ is an instance of \code{Invoca
tion} such that : | 3885 Then the method \code{noSuchMethod()} is looked up in $v_o$ and invoked with arg
ument $im$, and the result of this invocation is the result of evaluating $i$. H
owever, if the implementation found cannot be invoked with a single positional a
rgument, the implementation of \code{noSuchMethod()} in class \code{Object} is
invoked on $v_o$ with argument $im'$, where $im'$ is an instance of \code{Invoca
tion} such that : |
3875 \begin{itemize} | 3886 \begin{itemize} |
3876 \item \code{im'.isMethod} evaluates to \code{\TRUE{}}. | 3887 \item \code{im'.isMethod} evaluates to \code{\TRUE{}}. |
3877 \item \code{im'.memberName} evaluates to \code{\#noSuchMethod}. | 3888 \item \code{im'.memberName} evaluates to \code{\#noSuchMethod}. |
3878 \item \code{im'.positionalArguments} evaluates to an immutable list whose sole e
lement is $im$. | 3889 \item \code{im'.positionalArguments} evaluates to an immutable list whose sole e
lement is $im$. |
3879 \item \code{im'.namedArguments} evaluates to the value of \code{\CONST{} \{\}}. | 3890 \item \code{im'.namedArguments} evaluates to the value of \code{\CONST{} \{\}}. |
3880 \end{itemize} | 3891 \end{itemize} |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3953 Let $p_1 \ldots p_h$ be the required parameters of $f$, let $p_1 \ldots p_m$ be
the positional parameters of $f$ and let $p_{h+1}, \ldots, p_{h+l}$ be the opti
onal parameters declared by $f$. | 3964 Let $p_1 \ldots p_h$ be the required parameters of $f$, let $p_1 \ldots p_m$ be
the positional parameters of $f$ and let $p_{h+1}, \ldots, p_{h+l}$ be the opti
onal parameters declared by $f$. |
3954 | 3965 |
3955 \LMHash{} | 3966 \LMHash{} |
3956 If $n < h$, or $n > m$, the method lookup has failed. Furthermore, each $x_i, n
+1 \le i \le n+k$, must have a corresponding named parameter in the set $\{p_{m
+1}, \ldots, p_{h+l}\}$ or the method lookup also fails. Otherwise method looku
p has succeeded. | 3967 If $n < h$, or $n > m$, the method lookup has failed. Furthermore, each $x_i, n
+1 \le i \le n+k$, must have a corresponding named parameter in the set $\{p_{m
+1}, \ldots, p_{h+l}\}$ or the method lookup also fails. Otherwise method looku
p has succeeded. |
3957 | 3968 |
3958 \LMHash{} | 3969 \LMHash{} |
3959 If the method lookup succeeded, the body of $f$ is executed with respect to the
bindings that resulted from the evaluation of the argument list, and with \THIS{
} bound to the current value of \THIS{}. The value of $i$ is the value returned
after $f$ is executed. | 3970 If the method lookup succeeded, the body of $f$ is executed with respect to the
bindings that resulted from the evaluation of the argument list, and with \THIS{
} bound to the current value of \THIS{}. The value of $i$ is the value returned
after $f$ is executed. |
3960 | 3971 |
3961 \LMHash{} | 3972 \LMHash{} |
3962 If the method lookup has failed, then let $g$ be the result of looking up getter
(\ref{getterAndSetterLookup}) $m$ in $S_{dynamic}$ with respect to $L$. If the
getter lookup succeeded, let $v_g$ be the value of the getter invocation $\SUPER
{}.m$. Then the value of $i$ is the result of invoking | 3973 If the method lookup has failed, then let $g$ be the result of looking up getter
(\ref{getterAndSetterLookup}) $m$ in $S_{dynamic}$ with respect to $L$. If the
getter lookup succeeded, let $v_g$ be the value of the getter invocation $\SUPER
{}.m$. Then the value of $i$ is the result of invoking |
3963 the static method \code{Function.apply()} with arguments $v_g, [o_1, \ldots , o_
n], \{x_{n+1}: o_{n+1}, \ldots , x_{n+k}: o_{n+k}\}$. | 3974 the static method \code{Function.apply()} with arguments $v_g, [o_1, \ldots , o_
n], \{x_{n+1} = o_{n+1}, \ldots , x_{n+k} = o_{n+k}\}$. |
3964 | 3975 |
3965 \LMHash{} | 3976 \LMHash{} |
3966 If getter lookup has also failed, then a new instance $im$ of the predefined c
lass \code{Invocation} is created, such that : | 3977 If getter lookup has also failed, then a new instance $im$ of the predefined c
lass \code{Invocation} is created, such that : |
3967 \begin{itemize} | 3978 \begin{itemize} |
3968 \item \code{im.isMethod} evaluates to \code{\TRUE{}}. | 3979 \item \code{im.isMethod} evaluates to \code{\TRUE{}}. |
3969 \item \code{im.memberName} evaluates to the symbol \code{m}. | 3980 \item \code{im.memberName} evaluates to the symbol \code{m}. |
3970 \item \code{im.positionalArguments} evaluates to an immutable list with the same
values as \code{[$o_1, \ldots, o_n$]}. | 3981 \item \code{im.positionalArguments} evaluates to an immutable list with the same
values as \code{[$o_1, \ldots, o_n$]}. |
3971 \item \code{im.namedArguments} evaluates to an immutable map with the same keys
and values as \code{\{$x_{n+1}: o_{n+1}, \ldots, x_{n+k} : o_{n+k}$\}}. | 3982 \item \code{im.namedArguments} evaluates to an immutable map with the same keys
and values as \code{\{$\#x_{n+1}: o_{n+1}, \ldots, \#x_{n+k} : o_{n+k}$\}}. |
3972 \end{itemize} | 3983 \end{itemize} |
3973 Then the method \code{noSuchMethod()} is looked up in $S_{dynamic}$ and invoked
on \THIS{} with argument $im$, and the result of this invocation is the result o
f evaluating $i$. However, if the implementation found cannot be invoked with a
single positional argument, the implementation of \code{noSuchMethod()} in clas
s \code{Object} is invoked on \THIS{} with argument $im'$, where $im'$ is an ins
tance of \code{Invocation} such that : | 3984 Then the method \code{noSuchMethod()} is looked up in $S_{dynamic}$ and invoked
on \THIS{} with argument $im$, and the result of this invocation is the result o
f evaluating $i$. However, if the implementation found cannot be invoked with a
single positional argument, the implementation of \code{noSuchMethod()} in clas
s \code{Object} is invoked on \THIS{} with argument $im'$, where $im'$ is an ins
tance of \code{Invocation} such that : |
3974 \begin{itemize} | 3985 \begin{itemize} |
3975 \item \code{im'.isMethod} evaluates to \code{\TRUE{}}. | 3986 \item \code{im'.isMethod} evaluates to \code{\TRUE{}}. |
3976 \item \code{im'.memberName} evaluates to \code{\#noSuchMethod}. | 3987 \item \code{im'.memberName} evaluates to \code{\#noSuchMethod}. |
3977 \item \code{im'.positionalArguments} evaluates to an immutable list whose sole e
lement is $im$. | 3988 \item \code{im'.positionalArguments} evaluates to an immutable list whose sole e
lement is $im$. |
3978 \item \code{im'.namedArguments} evaluates to the value of \code{\CONST{} \{\}}. | 3989 \item \code{im'.namedArguments} evaluates to the value of \code{\CONST{} \{\}}. |
3979 \end{itemize} | 3990 \end{itemize} |
3980 | 3991 |
3981 and the result of this latter invocation is the result of evaluating $i$. | 3992 and the result of this latter invocation is the result of evaluating $i$. |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4266 \LMHash{} | 4277 \LMHash{} |
4267 Let $o$ be an object, and let $u$ be a fresh final variable bound to $o$. | 4278 Let $o$ be an object, and let $u$ be a fresh final variable bound to $o$. |
4268 The {\em closurization of method $f$ on object $o$} is defined to be equivalent
to: | 4279 The {\em closurization of method $f$ on object $o$} is defined to be equivalent
to: |
4269 \begin{itemize} | 4280 \begin{itemize} |
4270 \item $(a) \{\RETURN{}$ $u$ $op$ $a;$\} if $f$ is named $op$ and $op$ is one of
\code{$<$, $>$, $<$=, $>$=, ==, -, +, /, \~{}/, *, \%, $|$, \^{}, \&, $<<$, $>
>$} (this precludes closurization of unary -). | 4281 \item $(a) \{\RETURN{}$ $u$ $op$ $a;$\} if $f$ is named $op$ and $op$ is one of
\code{$<$, $>$, $<$=, $>$=, ==, -, +, /, \~{}/, *, \%, $|$, \^{}, \&, $<<$, $>
>$} (this precludes closurization of unary -). |
4271 \item $() \{\RETURN{}$ \~{} $u;$\} if $f$ is named \~{}. | 4282 \item $() \{\RETURN{}$ \~{} $u;$\} if $f$ is named \~{}. |
4272 \item $(a) \{\RETURN{}$ $u[a];$\} if $f$ is named $[]$. | 4283 \item $(a) \{\RETURN{}$ $u[a];$\} if $f$ is named $[]$. |
4273 \item $(a, b) \{\RETURN{}$ $u[a] = b;$\} if $f$ is named $[]=$. | 4284 \item $(a, b) \{\RETURN{}$ $u[a] = b;$\} if $f$ is named $[]=$. |
4274 \item | 4285 \item |
4275 \begin{dartCode} | 4286 \begin{dartCode} |
4276 $(r_1, \ldots, r_n, \{p_1 : d_1, \ldots , p_k : d_k\})$ \{ | 4287 $(r_1, \ldots, r_n, \{p_1 = d_1, \ldots , p_k = d_k\})$ \{ |
4277 \RETURN{} $ u.m(r_1, \ldots, r_n, p_1: p_1, \ldots, p_k: p_k);$ | 4288 \RETURN{} $ u.m(r_1, \ldots, r_n, p_1: p_1, \ldots, p_k: p_k);$ |
4278 \} | 4289 \} |
4279 \end{dartCode} | 4290 \end{dartCode} |
4280 if $f$ is named $m$ and has required parameters $r_1, \ldots, r_n$, and named pa
rameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots, d_k$. | 4291 if $f$ is named $m$ and has required parameters $r_1, \ldots, r_n$, and named pa
rameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots, d_k$. |
4281 \item | 4292 \item |
4282 \begin{dartCode} | 4293 \begin{dartCode} |
4283 $(r_1, \ldots, r_n, [p_1 = d_1, \ldots , p_k = d_k])$\{ | 4294 $(r_1, \ldots, r_n, [p_1 = d_1, \ldots , p_k = d_k])$\{ |
4284 \RETURN{} $u.m(r_1, \ldots, r_n, p_1, \ldots, p_k)$; | 4295 \RETURN{} $u.m(r_1, \ldots, r_n, p_1, \ldots, p_k)$; |
4285 \} | 4296 \} |
4286 \end{dartCode} | 4297 \end{dartCode} |
(...skipping 29 matching lines...) Expand all Loading... |
4316 | 4327 |
4317 | 4328 |
4318 \subsubsection{Named Constructor Closurization} | 4329 \subsubsection{Named Constructor Closurization} |
4319 \LMLabel{namedConstructorClosurization} | 4330 \LMLabel{namedConstructorClosurization} |
4320 | 4331 |
4321 \LMHash{} | 4332 \LMHash{} |
4322 The {\em closurization of constructor $f$ of type $T$} is defined to be equivale
nt to: | 4333 The {\em closurization of constructor $f$ of type $T$} is defined to be equivale
nt to: |
4323 \begin{itemize} | 4334 \begin{itemize} |
4324 \item | 4335 \item |
4325 \begin{dartCode} | 4336 \begin{dartCode} |
4326 $(r_1, \ldots, r_n, \{p_1 : d_1, \ldots , p_k : d_k\})$ \{ | 4337 $(r_1, \ldots, r_n, \{p_1 = d_1, \ldots , p_k = d_k\})$ \{ |
4327 \RETURN{} \NEW{} $T.m(r_1, \ldots, r_n, p_1: p_1, \ldots, p_k: p_k);$ | 4338 \RETURN{} \NEW{} $T.m(r_1, \ldots, r_n, p_1: p_1, \ldots, p_k: p_k);$ |
4328 \} | 4339 \} |
4329 \end{dartCode} | 4340 \end{dartCode} |
4330 | 4341 |
4331 if $f$ is a named constructor with name $m$ that has required parameters $r_1, \
ldots, r_n$, and named parameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots,
d_k$. | 4342 if $f$ is a named constructor with name $m$ that has required parameters $r_1, \
ldots, r_n$, and named parameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots,
d_k$. |
4332 \item | 4343 \item |
4333 \begin{dartCode} | 4344 \begin{dartCode} |
4334 $(r_1, \ldots, r_n, [p_1 = d_1, \ldots , p_k = d_k])$\{ | 4345 $(r_1, \ldots, r_n, [p_1 = d_1, \ldots , p_k = d_k])$\{ |
4335 \RETURN{} \NEW{} $T.m(r_1, \ldots, r_n, p_1, \ldots, p_k)$; | 4346 \RETURN{} \NEW{} $T.m(r_1, \ldots, r_n, p_1, \ldots, p_k)$; |
4336 \} | 4347 \} |
(...skipping 10 matching lines...) Expand all Loading... |
4347 } | 4358 } |
4348 | 4359 |
4349 \subsubsection{Anonymous Constructor Closurization} | 4360 \subsubsection{Anonymous Constructor Closurization} |
4350 \LMLabel{anonymousConstructorClosurization} | 4361 \LMLabel{anonymousConstructorClosurization} |
4351 | 4362 |
4352 \LMHash{} | 4363 \LMHash{} |
4353 The {\em closurization of anonymous constructor $f$ of type $T$} is defined to b
e equivalent to: | 4364 The {\em closurization of anonymous constructor $f$ of type $T$} is defined to b
e equivalent to: |
4354 \begin{itemize} | 4365 \begin{itemize} |
4355 \item | 4366 \item |
4356 \begin{dartCode} | 4367 \begin{dartCode} |
4357 $(r_1, \ldots, r_n, \{p_1 : d_1, \ldots , p_k : d_k\})$ \{ | 4368 $(r_1, \ldots, r_n, \{p_1 = d_1, \ldots , p_k = d_k\})$ \{ |
4358 \RETURN{} \NEW{} $T(r_1, \ldots, r_n, p_1: p_1, \ldots, p_k: p_k);$ | 4369 \RETURN{} \NEW{} $T(r_1, \ldots, r_n, p_1: p_1, \ldots, p_k: p_k);$ |
4359 \} | 4370 \} |
4360 \end{dartCode} | 4371 \end{dartCode} |
4361 | 4372 |
4362 if $f$ is an anonymous constructor that has required parameters $r_1, \ldots, r_
n$, and named parameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots, d_k$. | 4373 if $f$ is an anonymous constructor that has required parameters $r_1, \ldots, r_
n$, and named parameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots, d_k$. |
4363 \item | 4374 \item |
4364 \begin{dartCode} | 4375 \begin{dartCode} |
4365 $(r_1, \ldots, r_n, [p_1 = d_1, \ldots , p_k = d_k])$\{ | 4376 $(r_1, \ldots, r_n, [p_1 = d_1, \ldots , p_k = d_k])$\{ |
4366 \RETURN{} \NEW{} $T(r_1, \ldots, r_n, p_1, \ldots, p_k)$; | 4377 \RETURN{} \NEW{} $T(r_1, \ldots, r_n, p_1, \ldots, p_k)$; |
4367 \} | 4378 \} |
(...skipping 13 matching lines...) Expand all Loading... |
4381 The {\em closurization of method $f$ with respect to superclass $S$} is defined
to be equivalent to: | 4392 The {\em closurization of method $f$ with respect to superclass $S$} is defined
to be equivalent to: |
4382 | 4393 |
4383 \LMHash{} | 4394 \LMHash{} |
4384 \begin{itemize} | 4395 \begin{itemize} |
4385 \item $(a) \{\RETURN{}$ \SUPER{} $op$ $a;$\} if $f$ is named $op$ and $op$ is on
e of \code{$<$, $>$, $<$=, $>$=, ==, -, +, /, \~{}/, *, \%, $|$, \^{}, \&, $<<
$, $>>$}. | 4396 \item $(a) \{\RETURN{}$ \SUPER{} $op$ $a;$\} if $f$ is named $op$ and $op$ is on
e of \code{$<$, $>$, $<$=, $>$=, ==, -, +, /, \~{}/, *, \%, $|$, \^{}, \&, $<<
$, $>>$}. |
4386 \item $() \{\RETURN{}$ \~{}\SUPER;\} if $f$ is named \~{}. | 4397 \item $() \{\RETURN{}$ \~{}\SUPER;\} if $f$ is named \~{}. |
4387 \item $(a) \{\RETURN{}$ $\SUPER[a];$\} if $f$ is named $[]$. | 4398 \item $(a) \{\RETURN{}$ $\SUPER[a];$\} if $f$ is named $[]$. |
4388 \item $(a, b) \{\RETURN{}$ $\SUPER[a] = b;$\} if $f$ is named $[]=$. | 4399 \item $(a, b) \{\RETURN{}$ $\SUPER[a] = b;$\} if $f$ is named $[]=$. |
4389 \item | 4400 \item |
4390 \begin{dartCode} | 4401 \begin{dartCode} |
4391 $(r_1, \ldots, r_n, \{p_1 : d_1, \ldots , p_k : d_k\})$ \{ | 4402 $(r_1, \ldots, r_n, \{p_1 = d_1, \ldots , p_k = d_k\})$ \{ |
4392 \RETURN{} \SUPER$.m(r_1, \ldots, r_n, p_1: p_1, \ldots, p_k: p_k);$ | 4403 \RETURN{} \SUPER$.m(r_1, \ldots, r_n, p_1: p_1, \ldots, p_k: p_k);$ |
4393 \} | 4404 \} |
4394 \end{dartCode} | 4405 \end{dartCode} |
4395 if $f$ is named $m$ and has required parameters $r_1, \ldots, r_n$, and named pa
rameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots, d_k$. | 4406 if $f$ is named $m$ and has required parameters $r_1, \ldots, r_n$, and named pa
rameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots, d_k$. |
4396 \item | 4407 \item |
4397 \begin{dartCode} | 4408 \begin{dartCode} |
4398 $(r_1, \ldots, r_n, [p_1 = d_1, \ldots , p_k = d_k])$\{ | 4409 $(r_1, \ldots, r_n, [p_1 = d_1, \ldots , p_k = d_k])$\{ |
4399 \RETURN{} \SUPER$.m(r_1, \ldots, r_n, p_1, \ldots, p_k)$; | 4410 \RETURN{} \SUPER$.m(r_1, \ldots, r_n, p_1, \ldots, p_k)$; |
4400 \} | 4411 \} |
4401 \end{dartCode} | 4412 \end{dartCode} |
(...skipping 3499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7901 | 7912 |
7902 The invariant that each normative paragraph is associated with a line | 7913 The invariant that each normative paragraph is associated with a line |
7903 containing the text \LMHash{} should be maintained. Extra occurrences | 7914 containing the text \LMHash{} should be maintained. Extra occurrences |
7904 of \LMHash{} can be added if needed, e.g., in order to make | 7915 of \LMHash{} can be added if needed, e.g., in order to make |
7905 individual \item{}s in itemized lists addressable. Each \LM.. command | 7916 individual \item{}s in itemized lists addressable. Each \LM.. command |
7906 must occur on a separate line. \LMHash{} must occur immediately | 7917 must occur on a separate line. \LMHash{} must occur immediately |
7907 before the associated paragraph, and \LMLabel must occur immediately | 7918 before the associated paragraph, and \LMLabel must occur immediately |
7908 after the associated \section{}, \subsection{} etc. | 7919 after the associated \section{}, \subsection{} etc. |
7909 | 7920 |
7910 ---------------------------------------------------------------------- | 7921 ---------------------------------------------------------------------- |
OLD | NEW |