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 2451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2462 % so, checked mode? analyzers? editor/development compilers? | 2462 % so, checked mode? analyzers? editor/development compilers? |
2463 \commentary{ | 2463 \commentary{ |
2464 Note that there is no requirement that every constant expression evaluate correc
tly. Only when a constant expression is required (e.g., to initialize a constant
variable, or as a default value of a formal parameter, or as metadata) do we in
sist that a constant expression actually be evaluated successfully at compile ti
me. | 2464 Note that there is no requirement that every constant expression evaluate correc
tly. Only when a constant expression is required (e.g., to initialize a constant
variable, or as a default value of a formal parameter, or as metadata) do we in
sist that a constant expression actually be evaluated successfully at compile ti
me. |
2465 | 2465 |
2466 The above is not dependent on program control-flow. The mere presence of a requi
red compile time constant whose evaluation would fail within a program is an err
or. This also holds recursively: since compound constants are composed out of c
onstants, if any subpart of a constant would raise an exception when evaluated,
that is an error. | 2466 The above is not dependent on program control-flow. The mere presence of a requi
red compile time constant whose evaluation would fail within a program is an err
or. This also holds recursively: since compound constants are composed out of c
onstants, if any subpart of a constant would raise an exception when evaluated,
that is an error. |
2467 | 2467 |
2468 On the other hand, since implementations are free to compile code late, some com
pile-time errors may manifest quite late. | 2468 On the other hand, since implementations are free to compile code late, some com
pile-time errors may manifest quite late. |
2469 } | 2469 } |
2470 | 2470 |
2471 \begin{dartCode} | 2471 \begin{dartCode} |
2472 \CONST{} x = 1/0; | 2472 \CONST{} x = 1 ~/ 0; |
2473 \FINAL{} y = 1/0; | 2473 \FINAL{} y = 1 ~/ 0; |
2474 | 2474 |
2475 \CLASS{} K \{ | 2475 \CLASS{} K \{ |
2476 m1() \{ | 2476 m1() \{ |
2477 \VAR{} z = \FALSE{}; | 2477 \VAR{} z = \FALSE{}; |
2478 \IF{} (z) \{\RETURN{} x; \} | 2478 \IF{} (z) \{\RETURN{} x; \} |
2479 \ELSE{} \{ \RETURN{} 2;\} | 2479 \ELSE{} \{ \RETURN{} 2;\} |
2480 \} | 2480 \} |
2481 | 2481 |
2482 m2() \{ | 2482 m2() \{ |
2483 \IF{} (\TRUE{}) \{\RETURN{} y; \} | 2483 \IF{} (\TRUE{}) \{\RETURN{} y; \} |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2583 `0X' HEX\_DIGIT+ | 2583 `0X' HEX\_DIGIT+ |
2584 . | 2584 . |
2585 | 2585 |
2586 {\bf HEX\_DIGIT:}`a'{\escapegrammar ..}'f'; | 2586 {\bf HEX\_DIGIT:}`a'{\escapegrammar ..}'f'; |
2587 `A'{\escapegrammar ..}'F'; | 2587 `A'{\escapegrammar ..}'F'; |
2588 DIGIT | 2588 DIGIT |
2589 . | 2589 . |
2590 \end{grammar} | 2590 \end{grammar} |
2591 | 2591 |
2592 \LMHash{} | 2592 \LMHash{} |
2593 If a numeric literal begins with the prefix `0x' or `0X', it denotes the hexadec
imal integer represented by the part of the literal following `0x' (respectively
`0X'). Otherwise, if the numeric literal does not include a decimal point it d
enotes a decimal integer. Otherwise, the numeric literal denotes a 64 bit doub
le precision floating point number as specified by the IEEE 754 standard. | 2593 If a numeric literal begins with the prefix `0x' or `0X', it denotes the hexadec
imal integer represented by the part of the literal following `0x' (respectively
`0X'). Otherwise, if the numeric literal contains only decimal digits, it denot
es a decimal integer. Otherwise, the numeric literal contains either a decimal
point or an exponent part and it denotes a 64 bit double precision floating poin
t number as specified by the IEEE 754 standard. |
2594 | 2594 |
2595 \LMHash{} | 2595 \LMHash{} |
2596 In principle, the range of integers supported by a Dart implementations is unlim
ited. In practice, it is limited by available memory. Implementations may also b
e limited by other considerations. | 2596 In principle, the range of integers supported by a Dart implementations is unlim
ited. In practice, it is limited by available memory. Implementations may also b
e limited by other considerations. |
2597 | 2597 |
2598 \commentary{ | 2598 \commentary{ |
2599 For example, implementations may choose to limit the range to facilitate efficie
nt compilation to Javascript. These limitations should be relaxed as soon as tec
hnologically feasible. | 2599 For example, implementations may choose to limit the range to facilitate efficie
nt compilation to Javascript. These limitations should be relaxed as soon as tec
hnologically feasible. |
2600 } | 2600 } |
2601 | 2601 |
2602 \LMHash{} | 2602 \LMHash{} |
2603 It is a compile-time error for a class to attempt to extend, mix in or implement
\code{int}. It is a compile-time error for a class to attempt to extend, mix in
or implement \code{double}. It is a compile-time error for any type other than
the types \code{int} and \code{double} to attempt to extend, mix in or implement
\code{num}. | 2603 It is a compile-time error for a class to attempt to extend, mix in or implement
\code{int}. It is a compile-time error for a class to attempt to extend, mix in
or implement \code{double}. It is a compile-time error for any type other than
the types \code{int} and \code{double} to attempt to extend, mix in or implement
\code{num}. |
(...skipping 5293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7897 | 7897 |
7898 The invariant that each normative paragraph is associated with a line | 7898 The invariant that each normative paragraph is associated with a line |
7899 containing the text \LMHash{} should be maintained. Extra occurrences | 7899 containing the text \LMHash{} should be maintained. Extra occurrences |
7900 of \LMHash{} can be added if needed, e.g., in order to make | 7900 of \LMHash{} can be added if needed, e.g., in order to make |
7901 individual \item{}s in itemized lists addressable. Each \LM.. command | 7901 individual \item{}s in itemized lists addressable. Each \LM.. command |
7902 must occur on a separate line. \LMHash{} must occur immediately | 7902 must occur on a separate line. \LMHash{} must occur immediately |
7903 before the associated paragraph, and \LMLabel must occur immediately | 7903 before the associated paragraph, and \LMLabel must occur immediately |
7904 after the associated \section{}, \subsection{} etc. | 7904 after the associated \section{}, \subsection{} etc. |
7905 | 7905 |
7906 ---------------------------------------------------------------------- | 7906 ---------------------------------------------------------------------- |
OLD | NEW |