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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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:} |
748 normalFormalParameter ('=' expression)? | |
eernst
2016/10/11 20:59:50
We might as well use `=' (also in line 744), in or
Lasse Reichstein Nielsen
2016/10/12 06:10:58
Ack. Let's be consistent, even if the difference i
| |
748 normalFormalParameter ( `{\escapegrammar :}' expression)? | 749 normalFormalParameter ( `{\escapegrammar :}' expression)? |
749 . | 750 . |
750 \end{grammar} | 751 \end{grammar} |
751 | 752 |
753 A {\bf defaultNamedParameter} on the form: | |
754 \begin{code} | |
755 normalFormalParameter : expression | |
756 \end{code} | |
757 is equivalent to one on the form: | |
758 \begin{code} | |
759 normalFormalParameter = expression | |
760 \end{code} | |
761 The colon-syntax is included only for backwards compatibility. | |
762 It is deprecated and will be removed in a later version of the language specific ation. | |
763 | |
752 \LMHash{} | 764 \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. | 765 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 | 766 |
755 \LMHash{} | 767 \LMHash{} |
756 It is a compile-time error if the name of a named optional parameter begins with an `\_' character. | 768 It is a compile-time error if the name of a named optional parameter begins with an `\_' character. |
757 | 769 |
758 \rationale{ | 770 \rationale{ |
759 The need for this restriction is a direct consequence of the fact that naming a nd privacy are not orthogonal. | 771 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. | 772 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 } | 773 } |
(...skipping 2381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3143 \cd{\CLASS{} C$<$T$>$ \IMPLEMENTS{} Future$<$C$<$C$<$T$>>>$ \ldots } | 3155 \cd{\CLASS{} C$<$T$>$ \IMPLEMENTS{} Future$<$C$<$C$<$T$>>>$ \ldots } |
3144 | 3156 |
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. | 3157 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 | 3158 |
3147 } | 3159 } |
3148 | 3160 |
3149 | 3161 |
3150 \LMHash{} | 3162 \LMHash{} |
3151 The static type of a function literal of the form | 3163 The static type of a function literal of the form |
3152 | 3164 |
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$ | 3165 $(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 | 3166 is |
3155 | 3167 |
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$. | 3168 $(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 | 3169 |
3158 \LMHash{} | 3170 \LMHash{} |
3159 The static type of a function literal of the form | 3171 The static type of a function literal of the form |
3160 | 3172 |
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$ | 3173 $(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 | 3174 |
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$. | 3175 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 | 3176 |
3165 \LMHash{} | 3177 \LMHash{} |
3166 The static type of a function literal of the form | 3178 The static type of a function literal of the form |
3167 | 3179 |
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\}$ | 3180 $(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 | 3181 |
3170 is $(T_1 \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \rightarro w \DYNAMIC{}$. | 3182 is $(T_1 \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \rightarro w \DYNAMIC{}$. |
3171 | 3183 |
(...skipping 20 matching lines...) Expand all Loading... | |
3192 The static type of a function literal of the form | 3204 The static type of a function literal of the form |
3193 | 3205 |
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\}$ | 3206 $(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 | 3207 |
3196 is $(T_1 \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \rightarro w \DYNAMIC{}$. | 3208 is $(T_1 \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \rightarro w \DYNAMIC{}$. |
3197 | 3209 |
3198 | 3210 |
3199 \LMHash{} | 3211 \LMHash{} |
3200 The static type of a function literal of the form | 3212 The static type of a function literal of the form |
3201 | 3213 |
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\}$ | 3214 $(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 | 3215 |
3204 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightar row Future{}$. | 3216 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightar row Future{}$. |
3205 | 3217 |
3206 \LMHash{} | 3218 \LMHash{} |
3207 The static type of a function literal of the form | 3219 The static type of a function literal of the form |
3208 | 3220 |
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\}$ | 3221 $(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 | 3222 |
3211 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightar row Stream{}$. | 3223 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightar row Stream{}$. |
3212 | 3224 |
3213 \LMHash{} | 3225 \LMHash{} |
3214 The static type of a function literal of the form | 3226 The static type of a function literal of the form |
3215 | 3227 |
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\}$ | 3228 $(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 | 3229 |
3218 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightar row Iterable{}$. | 3230 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightar row Iterable{}$. |
3219 | 3231 |
3220 \LMHash{} | 3232 \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{}. | 3233 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 | 3234 |
3223 | 3235 |
3224 \subsection{ This} | 3236 \subsection{ This} |
3225 \LMLabel{this} | 3237 \LMLabel{this} |
3226 | 3238 |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3852 \LMHash{} | 3864 \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. | 3865 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 | 3866 |
3855 \LMHash{} | 3867 \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. | 3868 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 | 3869 |
3858 \LMHash{} | 3870 \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$. | 3871 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. | 3872 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 | 3873 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}\}$. | 3874 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 | 3875 |
3864 \LMHash{} | 3876 \LMHash{} |
3865 If getter lookup has also failed, then a new instance $im$ of the predefined c lass \code{Invocation} is created, such that : | 3877 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} | 3878 \begin{itemize} |
3867 \item \code{im.isMethod} evaluates to \code{\TRUE{}}. | 3879 \item \code{im.isMethod} evaluates to \code{\TRUE{}}. |
3868 \item \code{im.memberName} evaluates to the symbol \code{m}. | 3880 \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$]}. | 3881 \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}$\}}. | 3882 \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} | 3883 \end{itemize} |
3872 | 3884 |
3873 \LMHash{} | 3885 \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 : | 3886 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} | 3887 \begin{itemize} |
3876 \item \code{im'.isMethod} evaluates to \code{\TRUE{}}. | 3888 \item \code{im'.isMethod} evaluates to \code{\TRUE{}}. |
3877 \item \code{im'.memberName} evaluates to \code{\#noSuchMethod}. | 3889 \item \code{im'.memberName} evaluates to \code{\#noSuchMethod}. |
3878 \item \code{im'.positionalArguments} evaluates to an immutable list whose sole e lement is $im$. | 3890 \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{} \{\}}. | 3891 \item \code{im'.namedArguments} evaluates to the value of \code{\CONST{} \{\}}. |
3880 \end{itemize} | 3892 \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$. | 3965 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 | 3966 |
3955 \LMHash{} | 3967 \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. | 3968 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 | 3969 |
3958 \LMHash{} | 3970 \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. | 3971 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 | 3972 |
3961 \LMHash{} | 3973 \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 | 3974 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}\}$. | 3975 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 | 3976 |
3965 \LMHash{} | 3977 \LMHash{} |
3966 If getter lookup has also failed, then a new instance $im$ of the predefined c lass \code{Invocation} is created, such that : | 3978 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} | 3979 \begin{itemize} |
3968 \item \code{im.isMethod} evaluates to \code{\TRUE{}}. | 3980 \item \code{im.isMethod} evaluates to \code{\TRUE{}}. |
3969 \item \code{im.memberName} evaluates to the symbol \code{m}. | 3981 \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$]}. | 3982 \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}$\}}. | 3983 \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} | 3984 \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 : | 3985 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} | 3986 \begin{itemize} |
3975 \item \code{im'.isMethod} evaluates to \code{\TRUE{}}. | 3987 \item \code{im'.isMethod} evaluates to \code{\TRUE{}}. |
3976 \item \code{im'.memberName} evaluates to \code{\#noSuchMethod}. | 3988 \item \code{im'.memberName} evaluates to \code{\#noSuchMethod}. |
3977 \item \code{im'.positionalArguments} evaluates to an immutable list whose sole e lement is $im$. | 3989 \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{} \{\}}. | 3990 \item \code{im'.namedArguments} evaluates to the value of \code{\CONST{} \{\}}. |
3979 \end{itemize} | 3991 \end{itemize} |
3980 | 3992 |
3981 and the result of this latter invocation is the result of evaluating $i$. | 3993 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{} | 4278 \LMHash{} |
4267 Let $o$ be an object, and let $u$ be a fresh final variable bound to $o$. | 4279 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: | 4280 The {\em closurization of method $f$ on object $o$} is defined to be equivalent to: |
4269 \begin{itemize} | 4281 \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 -). | 4282 \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 \~{}. | 4283 \item $() \{\RETURN{}$ \~{} $u;$\} if $f$ is named \~{}. |
4272 \item $(a) \{\RETURN{}$ $u[a];$\} if $f$ is named $[]$. | 4284 \item $(a) \{\RETURN{}$ $u[a];$\} if $f$ is named $[]$. |
4273 \item $(a, b) \{\RETURN{}$ $u[a] = b;$\} if $f$ is named $[]=$. | 4285 \item $(a, b) \{\RETURN{}$ $u[a] = b;$\} if $f$ is named $[]=$. |
4274 \item | 4286 \item |
4275 \begin{dartCode} | 4287 \begin{dartCode} |
4276 $(r_1, \ldots, r_n, \{p_1 : d_1, \ldots , p_k : d_k\})$ \{ | 4288 $(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);$ | 4289 \RETURN{} $ u.m(r_1, \ldots, r_n, p_1: p_1, \ldots, p_k: p_k);$ |
4278 \} | 4290 \} |
4279 \end{dartCode} | 4291 \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$. | 4292 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 | 4293 \item |
4282 \begin{dartCode} | 4294 \begin{dartCode} |
4283 $(r_1, \ldots, r_n, [p_1 = d_1, \ldots , p_k = d_k])$\{ | 4295 $(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)$; | 4296 \RETURN{} $u.m(r_1, \ldots, r_n, p_1, \ldots, p_k)$; |
4285 \} | 4297 \} |
4286 \end{dartCode} | 4298 \end{dartCode} |
(...skipping 29 matching lines...) Expand all Loading... | |
4316 | 4328 |
4317 | 4329 |
4318 \subsubsection{Named Constructor Closurization} | 4330 \subsubsection{Named Constructor Closurization} |
4319 \LMLabel{namedConstructorClosurization} | 4331 \LMLabel{namedConstructorClosurization} |
4320 | 4332 |
4321 \LMHash{} | 4333 \LMHash{} |
4322 The {\em closurization of constructor $f$ of type $T$} is defined to be equivale nt to: | 4334 The {\em closurization of constructor $f$ of type $T$} is defined to be equivale nt to: |
4323 \begin{itemize} | 4335 \begin{itemize} |
4324 \item | 4336 \item |
4325 \begin{dartCode} | 4337 \begin{dartCode} |
4326 $(r_1, \ldots, r_n, \{p_1 : d_1, \ldots , p_k : d_k\})$ \{ | 4338 $(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);$ | 4339 \RETURN{} \NEW{} $T.m(r_1, \ldots, r_n, p_1: p_1, \ldots, p_k: p_k);$ |
4328 \} | 4340 \} |
4329 \end{dartCode} | 4341 \end{dartCode} |
4330 | 4342 |
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$. | 4343 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 | 4344 \item |
4333 \begin{dartCode} | 4345 \begin{dartCode} |
4334 $(r_1, \ldots, r_n, [p_1 = d_1, \ldots , p_k = d_k])$\{ | 4346 $(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)$; | 4347 \RETURN{} \NEW{} $T.m(r_1, \ldots, r_n, p_1, \ldots, p_k)$; |
4336 \} | 4348 \} |
(...skipping 10 matching lines...) Expand all Loading... | |
4347 } | 4359 } |
4348 | 4360 |
4349 \subsubsection{Anonymous Constructor Closurization} | 4361 \subsubsection{Anonymous Constructor Closurization} |
4350 \LMLabel{anonymousConstructorClosurization} | 4362 \LMLabel{anonymousConstructorClosurization} |
4351 | 4363 |
4352 \LMHash{} | 4364 \LMHash{} |
4353 The {\em closurization of anonymous constructor $f$ of type $T$} is defined to b e equivalent to: | 4365 The {\em closurization of anonymous constructor $f$ of type $T$} is defined to b e equivalent to: |
4354 \begin{itemize} | 4366 \begin{itemize} |
4355 \item | 4367 \item |
4356 \begin{dartCode} | 4368 \begin{dartCode} |
4357 $(r_1, \ldots, r_n, \{p_1 : d_1, \ldots , p_k : d_k\})$ \{ | 4369 $(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);$ | 4370 \RETURN{} \NEW{} $T(r_1, \ldots, r_n, p_1: p_1, \ldots, p_k: p_k);$ |
4359 \} | 4371 \} |
4360 \end{dartCode} | 4372 \end{dartCode} |
4361 | 4373 |
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$. | 4374 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 | 4375 \item |
4364 \begin{dartCode} | 4376 \begin{dartCode} |
4365 $(r_1, \ldots, r_n, [p_1 = d_1, \ldots , p_k = d_k])$\{ | 4377 $(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)$; | 4378 \RETURN{} \NEW{} $T(r_1, \ldots, r_n, p_1, \ldots, p_k)$; |
4367 \} | 4379 \} |
(...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: | 4393 The {\em closurization of method $f$ with respect to superclass $S$} is defined to be equivalent to: |
4382 | 4394 |
4383 \LMHash{} | 4395 \LMHash{} |
4384 \begin{itemize} | 4396 \begin{itemize} |
4385 \item $(a) \{\RETURN{}$ \SUPER{} $op$ $a;$\} if $f$ is named $op$ and $op$ is on e of \code{$<$, $>$, $<$=, $>$=, ==, -, +, /, \~{}/, *, \%, $|$, \^{}, \&, $<< $, $>>$}. | 4397 \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 \~{}. | 4398 \item $() \{\RETURN{}$ \~{}\SUPER;\} if $f$ is named \~{}. |
4387 \item $(a) \{\RETURN{}$ $\SUPER[a];$\} if $f$ is named $[]$. | 4399 \item $(a) \{\RETURN{}$ $\SUPER[a];$\} if $f$ is named $[]$. |
4388 \item $(a, b) \{\RETURN{}$ $\SUPER[a] = b;$\} if $f$ is named $[]=$. | 4400 \item $(a, b) \{\RETURN{}$ $\SUPER[a] = b;$\} if $f$ is named $[]=$. |
4389 \item | 4401 \item |
4390 \begin{dartCode} | 4402 \begin{dartCode} |
4391 $(r_1, \ldots, r_n, \{p_1 : d_1, \ldots , p_k : d_k\})$ \{ | 4403 $(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);$ | 4404 \RETURN{} \SUPER$.m(r_1, \ldots, r_n, p_1: p_1, \ldots, p_k: p_k);$ |
4393 \} | 4405 \} |
4394 \end{dartCode} | 4406 \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$. | 4407 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 | 4408 \item |
4397 \begin{dartCode} | 4409 \begin{dartCode} |
4398 $(r_1, \ldots, r_n, [p_1 = d_1, \ldots , p_k = d_k])$\{ | 4410 $(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)$; | 4411 \RETURN{} \SUPER$.m(r_1, \ldots, r_n, p_1, \ldots, p_k)$; |
4400 \} | 4412 \} |
4401 \end{dartCode} | 4413 \end{dartCode} |
(...skipping 3499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7901 | 7913 |
7902 The invariant that each normative paragraph is associated with a line | 7914 The invariant that each normative paragraph is associated with a line |
7903 containing the text \LMHash{} should be maintained. Extra occurrences | 7915 containing the text \LMHash{} should be maintained. Extra occurrences |
7904 of \LMHash{} can be added if needed, e.g., in order to make | 7916 of \LMHash{} can be added if needed, e.g., in order to make |
7905 individual \item{}s in itemized lists addressable. Each \LM.. command | 7917 individual \item{}s in itemized lists addressable. Each \LM.. command |
7906 must occur on a separate line. \LMHash{} must occur immediately | 7918 must occur on a separate line. \LMHash{} must occur immediately |
7907 before the associated paragraph, and \LMLabel must occur immediately | 7919 before the associated paragraph, and \LMLabel must occur immediately |
7908 after the associated \section{}, \subsection{} etc. | 7920 after the associated \section{}, \subsection{} etc. |
7909 | 7921 |
7910 ---------------------------------------------------------------------- | 7922 ---------------------------------------------------------------------- |
OLD | NEW |