Changeset c4d4ecf

Ignore:
Timestamp:
Feb 13, 2018, 9:55:21 AM (4 years ago)
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
418d773
Parents:
e6e3445
Message:

small wording changes in switch-statement section

File:
1 edited

Legend:

Unmodified
 re6e3445 \end{cfa} \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. \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. \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. C @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}. @case@ clauses are made disjoint by the @break@ statement. While 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. \CFA provides a new control structure, @choose@ that mimics the @switch@, but reverses the meaning of fall through: \CFA provides a new control structure, @choose@, which mimics @switch@, but reverses the meaning of fall through: \begin{cquote} \lstDeleteShortInline@% \begin{cfa} choose ( day ) { case Mon, Tue, Wed, Thu: case Mon~Thu: // program