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 \usepackage[T1]{fontenc} | 8 \usepackage[T1]{fontenc} |
9 \newcommand{\code}[1]{{\sf #1}} | 9 \newcommand{\code}[1]{{\sf #1}} |
10 \title{Dart Programming Language Specification \\ | 10 \title{Dart Programming Language Specification \\ |
(...skipping 6756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6767 and completes in the same way as the assertion. | 6767 and completes in the same way as the assertion. |
6768 | 6768 |
6769 \LMHash{} | 6769 \LMHash{} |
6770 In production mode the assertion has no effect | 6770 In production mode the assertion has no effect |
6771 and its execution immediately completes normally (\ref{completion}). | 6771 and its execution immediately completes normally (\ref{completion}). |
6772 In checked mode, | 6772 In checked mode, |
6773 execution of an assertion \code{\ASSERT{}($c$, $e$)} proceeds as follows: | 6773 execution of an assertion \code{\ASSERT{}($c$, $e$)} proceeds as follows: |
6774 | 6774 |
6775 \LMHash{} | 6775 \LMHash{} |
6776 The expression $c$ is evaluated to an object $o$. | 6776 The expression $c$ is evaluated to an object $o$. |
6777 If the class of $o$ is not a subtype of \code{Function} then | 6777 If the class of $o$ is a subtype of \code{Function} and assertion occurs in the initializer list of a \CONST{} constructor, |
eernst
2017/07/10 13:03:58
Typo: `and [the] assertion`.
But I don't get this
| |
6778 let $r$ be $o$. | 6778 then let $r$ be the result of invoking $o$ with no arguments. |
6779 Otherwise, | 6779 Otherwise let $r$ be $o$. |
6780 if the assertion occurs in the initializer list of a \CONST{} constructor, | 6780 It is a dynamic type error if $r$ is not of type \code{bool}. |
6781 then we say that the assertion failed, | 6781 If $r$ is \TRUE{}, execution of the assert statement completes normally (\ref{co mpletion}). |
6782 otherwise let $r$ be the result of invoking $o$ with no arguments. | 6782 Otherwise, $e$ is evaluated to an object $m$. |
6783 It is a dynamic type error if $o$ is not of type \code{bool} or of type \code{Fu nction}, or if $r$ is not of type \code{bool}. | |
6784 If $r$ is \FALSE{}, we say that the assertion failed. | |
6785 If $r$ is \TRUE{}, we say that the assertion succeeded. | |
6786 If the assertion succeeded, execution of the assert statement completes normally (\ref{completion}). | |
6787 If the assertion failed, $e$ is evaluated to an object $m$. | |
6788 Then the execution of the assert statement throws (\ref{completion}) an \code{As sertionError} containing $m$ and with a stack trace corresponding to the current execution state at the \ASSERT{} statement. | 6783 Then the execution of the assert statement throws (\ref{completion}) an \code{As sertionError} containing $m$ and with a stack trace corresponding to the current execution state at the \ASSERT{} statement. |
6789 | 6784 |
6790 \LMHash{} | 6785 \LMHash{} |
6791 It is a static type warning if the type of $e$ may not be assigned to either | 6786 It is a static type warning if the type of $e$ may not be assigned to either |
6792 \code{bool} or $() \rightarrow$ \code{bool}. | 6787 \code{bool} or $() \rightarrow$ \code{bool}. |
6793 If the assertion occurs in a \CONST{} constructor initializer list, it is a stat ic type warning if the type of $e$ may not be assigned to \code{bool}. | 6788 If the assertion occurs in a \CONST{} constructor initializer list, it is a stat ic type warning if the type of $e$ may not be assigned to \code{bool}. |
6794 | 6789 |
6795 \rationale{Why is this a statement, not a built in function call? Because it is handled magically so it has no effect and no overhead in production mode. Also, in the absence of final methods. one could not prevent it being overridden (thou gh there is no real harm in that). It cannot be viewed as a function call that is being optimized away because the argument might have side effects. | 6790 \rationale{Why is this a statement, not a built in function call? Because it is handled magically so it has no effect and no overhead in production mode. Also, in the absence of final methods. one could not prevent it being overridden (thou gh there is no real harm in that). It cannot be viewed as a function call that is being optimized away because the argument might have side effects. |
6796 } | 6791 } |
6797 | 6792 |
(...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8238 | 8233 |
8239 The invariant that each normative paragraph is associated with a line | 8234 The invariant that each normative paragraph is associated with a line |
8240 containing the text \LMHash{} should be maintained. Extra occurrences | 8235 containing the text \LMHash{} should be maintained. Extra occurrences |
8241 of \LMHash{} can be added if needed, e.g., in order to make | 8236 of \LMHash{} can be added if needed, e.g., in order to make |
8242 individual \item{}s in itemized lists addressable. Each \LM.. command | 8237 individual \item{}s in itemized lists addressable. Each \LM.. command |
8243 must occur on a separate line. \LMHash{} must occur immediately | 8238 must occur on a separate line. \LMHash{} must occur immediately |
8244 before the associated paragraph, and \LMLabel must occur immediately | 8239 before the associated paragraph, and \LMLabel must occur immediately |
8245 after the associated \section{}, \subsection{} etc. | 8240 after the associated \section{}, \subsection{} etc. |
8246 | 8241 |
8247 ---------------------------------------------------------------------- | 8242 ---------------------------------------------------------------------- |
OLD | NEW |