Changeset d96f7c4 for doc/user/user.tex


Ignore:
Timestamp:
Jan 17, 2025, 3:46:34 PM (2 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
df56e25
Parents:
3b340d68
Message:

expunge fallthru keyword and replace its usages with fallthrough

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified doc/user/user.tex

    r3b340d68 rd96f7c4  
    1111%% Created On       : Wed Apr  6 14:53:29 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Sat Dec  7 16:53:37 2024
    14 %% Update Count     : 6970
     13%% Last Modified On : Fri Jan 17 14:20:39 2025
     14%% Update Count     : 6971
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    893893still works.
    894894Nevertheless, 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:
     895Therefore, 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:
    896896\begin{cfa}
    897897®choose® ( i ) {
     
    901901  case 5:
    902902        ...
    903         ®fallthru®; §\C{// explicit fall through}§
     903        ®fallthrough®; §\C{// explicit fall through}§
    904904  case 7:
    905905        ...
     
    911911Like the ©switch© statement, the ©choose© statement retains the fall-through semantics for a list of ©case© clauses.
    912912An implicit ©break© is applied only at the end of the \emph{statements} following a ©case© clause.
    913 An explicit ©fallthru© is retained because it is a C-idiom most C programmers expect, and its absence might discourage programmers from using the ©choose© statement.
     913An 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.
    914914As well, allowing an explicit ©break© from the ©choose© is a carry over from the ©switch© statement, and expected by C programmers.
    915915\item
     
    950950  case 3:
    951951        if ( ... ) {
    952                 ... ®fallthru;® // goto case 4
     952                ... ®fallthrough;® // goto case 4
    953953        } else {
    954954                ...
     
    985985                for ( ... ) {
    986986                        // multi-level transfer
    987                         ... ®fallthru common;®
     987                        ... ®fallthrough common;®
    988988                }
    989989                ...
     
    80538053\begin{cquote}
    80548054\Indexc{basetypeof}, \Indexc{choose}, \Indexc{coroutine}, \Indexc{disable},
    8055 \Indexc{enable}, \Indexc{exception}, \Indexc{fallthrough}, \Indexc{fallthru},
     8055\Indexc{enable}, \Indexc{exception}, \Indexc{fallthrough}, \Indexc{fallthrough},
    80568056\Indexc{finally}, \Indexc{fixup}, \Indexc{forall},\Indexc{generator},
    80578057\Indexc{int128}, \Indexc{monitor}, \Indexc{mutex}, \Indexc{one_t},
     
    80798079\Indexc{exception}              \\
    80808080\Indexc{fallthrough}    \\
    8081 \Indexc{fallthru}               \\
     8081\Indexc{fallthrough}    \\
    80828082\end{tabular}
    80838083&
Note: See TracChangeset for help on using the changeset viewer.