Changeset c4d4ecf
- Timestamp:
- Feb 13, 2018, 9:55:21 AM (7 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/papers/general/Paper.tex
re6e3445 rc4d4ecf 1114 1114 \end{cfa} 1115 1115 \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. 1117 1117 1118 1118 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}. 1119 1119 @case@ clauses are made disjoint by the @break@ statement. 1120 1120 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. 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: 1122 1122 \begin{cquote} 1123 1123 \lstDeleteShortInline@% … … 1126 1126 \begin{cfa} 1127 1127 `choose` ( day ) { 1128 case Mon , Tue, Wed,Thu:1128 case Mon~Thu: 1129 1129 // program 1130 1130
Note: See TracChangeset
for help on using the changeset viewer.