Changeset c4d4ecf


Ignore:
Timestamp:
Feb 13, 2018, 9:55:21 AM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
418d773a
Parents:
e6e3445
Message:

small wording changes in switch-statement section

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/papers/general/Paper.tex

    re6e3445 rc4d4ecf  
    11141114\end{cfa}
    11151115\CFA allows the declaration of local variables, \eg @y@, at the start of the @switch@ with scope across the entire @switch@ body, \ie all @case@ clauses, but no statements.
    1116 \CFA disallows the declaration of local variable, \eg @z@, within the @switch@ body, because a declaration cannot occur immediately after a @case@ since a label can only be attached to a statement, and the use of @z@ is undefined in @case 1@ as neither storage allocation nor initialization may have occurred.
     1116\CFA disallows the declaration of local variable, \eg @z@, directly within the @switch@ body, because a declaration cannot occur immediately after a @case@ since a label can only be attached to a statement, and the use of @z@ is undefined in @case 1@ as neither storage allocation nor initialization may have occurred.
    11171117
    11181118C @switch@ provides multiple entry points into the statement body, but once an entry point is selected, control continues across \emph{all} @case@ clauses until the end of the @switch@ body, called \newterm{fall through}.
    11191119@case@ clauses are made disjoint by the @break@ statement.
    11201120While the ability to fall through \emph{is} a useful form of control flow, it does not match well with programmer intuition, resulting in many errors from missing @break@ statements.
    1121 \CFA provides a new control structure, @choose@ that mimics the @switch@, but reverses the meaning of fall through:
     1121\CFA provides a new control structure, @choose@, which mimics @switch@, but reverses the meaning of fall through:
    11221122\begin{cquote}
    11231123\lstDeleteShortInline@%
     
    11261126\begin{cfa}
    11271127`choose` ( day ) {
    1128   case Mon, Tue, Wed, Thu:
     1128  case Mon~Thu:
    11291129        // program
    11301130
Note: See TracChangeset for help on using the changeset viewer.