Changeset d96f7c4 for doc/user/user.tex
- Timestamp:
- Jan 17, 2025, 3:46:34 PM (2 months ago)
- Branches:
- master
- Children:
- df56e25
- Parents:
- 3b340d68
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified doc/user/user.tex ¶
r3b340d68 rd96f7c4 11 11 %% Created On : Wed Apr 6 14:53:29 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Sat Dec 7 16:53:37 202414 %% Update Count : 697 013 %% Last Modified On : Fri Jan 17 14:20:39 2025 14 %% Update Count : 6971 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 893 893 still works. 894 894 Nevertheless, reversing the default action would have a non-trivial effect on case actions that compound, such as the above example of processing shell arguments. 895 Therefore, to preserve backwards compatibility, it is necessary to introduce a new kind of ©switch© statement, called \Indexc{choose}, with no implicit fall-through semantics and an explicit fall-through if the last statement of a case-clause ends with the new keyword \Indexc{fallthrough} /\-\Indexc{fallthru}, \eg:895 Therefore, to preserve backwards compatibility, it is necessary to introduce a new kind of ©switch© statement, called \Indexc{choose}, with no implicit fall-through semantics and an explicit fall-through if the last statement of a case-clause ends with the new keyword \Indexc{fallthrough}, \eg: 896 896 \begin{cfa} 897 897 ®choose® ( i ) { … … 901 901 case 5: 902 902 ... 903 ®fallthr u®; §\C{// explicit fall through}§903 ®fallthrough®; §\C{// explicit fall through}§ 904 904 case 7: 905 905 ... … … 911 911 Like the ©switch© statement, the ©choose© statement retains the fall-through semantics for a list of ©case© clauses. 912 912 An implicit ©break© is applied only at the end of the \emph{statements} following a ©case© clause. 913 An explicit ©fallthr u© is retained because it is a C-idiom most C programmers expect, and its absence might discourage programmers from using the ©choose© statement.913 An explicit ©fallthrough© is retained because it is a C-idiom most C programmers expect, and its absence might discourage programmers from using the ©choose© statement. 914 914 As well, allowing an explicit ©break© from the ©choose© is a carry over from the ©switch© statement, and expected by C programmers. 915 915 \item … … 950 950 case 3: 951 951 if ( ... ) { 952 ... ®fallthr u;® // goto case 4952 ... ®fallthrough;® // goto case 4 953 953 } else { 954 954 ... … … 985 985 for ( ... ) { 986 986 // multi-level transfer 987 ... ®fallthr ucommon;®987 ... ®fallthrough common;® 988 988 } 989 989 ... … … 8053 8053 \begin{cquote} 8054 8054 \Indexc{basetypeof}, \Indexc{choose}, \Indexc{coroutine}, \Indexc{disable}, 8055 \Indexc{enable}, \Indexc{exception}, \Indexc{fallthrough}, \Indexc{fallthr u},8055 \Indexc{enable}, \Indexc{exception}, \Indexc{fallthrough}, \Indexc{fallthrough}, 8056 8056 \Indexc{finally}, \Indexc{fixup}, \Indexc{forall},\Indexc{generator}, 8057 8057 \Indexc{int128}, \Indexc{monitor}, \Indexc{mutex}, \Indexc{one_t}, … … 8079 8079 \Indexc{exception} \\ 8080 8080 \Indexc{fallthrough} \\ 8081 \Indexc{fallthr u}\\8081 \Indexc{fallthrough} \\ 8082 8082 \end{tabular} 8083 8083 &
Note: See TracChangeset
for help on using the changeset viewer.