Changeset 2c2e865 for doc/user/user.tex


Ignore:
Timestamp:
Mar 20, 2026, 8:23:59 AM (33 hours ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
c6d65a1
Parents:
5c56a22
Message:

update user documentation on AST dump flags, and turn off silent in Makefile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/user/user.tex

    r5c56a22 r2c2e865  
    1111%% Created On       : Wed Apr  6 14:53:29 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Wed Sep 17 09:15:48 2025
    14 %% Update Count     : 7251
     13%% Last Modified On : Fri Mar 20 08:05:59 2026
     14%% Update Count     : 7399
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    153153% Any language feature that is not described here can be assumed to be using the standard \Celeven syntax.
    154154\CFA adds many modern features that directly lead to increased \emph{\Index{safety}} and \emph{\Index{productivity}}, while maintaining interoperability with existing C programs and achieving similar performance.
    155 Like C, \CFA is a statically typed, procedural (non-\Index{object-oriented}) language with a low-overhead runtime, meaning there is no global \Index{garbage-collection}, but \Index{regional garbage-collection}\index{garbage-collection!regional} is possible.
     155Like C, \CFA is a statically typed, procedural (non-\Index{object-oriented}) language with a low-overhead runtime, meaning there is \Index{managed memory} (no global \Index{garbage-collection}, but \Index{regional garbage-collection}\index{garbage-collection!regional} is possible.
    156156The primary new features include polymorphic routines and types, exceptions, concurrency, and modules.
    157157
    158158One of the main design philosophies of \CFA is to ``\Index{describe not prescribe}'', which means \CFA tries to provide a pathway from low-level C programming to high-level \CFA programming, but it does not force programmers to ``do the right thing''.
     159There is no notion or requirement of \emph{rewriting} a legacy C program to \CFA.
    159160Programmers can cautiously add \CFA extensions to their C programs in any order and at any time to incrementally move towards safer, higher-level programming.
    160 A programmer is always free to reach back to C from \CFA, for any reason, and in many cases, new \CFA features can be locally switched back to their C counterpart.
    161 There is no notion or requirement for \emph{rewriting} a legacy C program to \CFA;
    162 instead, a programmer evolves a legacy program into \CFA by incrementally incorporating \CFA features.
    163 As well, new programs can be written in \CFA using a combination of C and \CFA features.
    164161In many ways, \CFA is to C as \Index{Scala}~\cite{Scala} is to Java, providing a vehicle for new typing and control-flow capabilities on top of a highly popular programming language allowing immediate dissemination.
    165162
     
    211208The manual does not teach programming, \ie how to combine the new constructs to build complex programs.
    212209The reader must have an intermediate knowledge of control flow, data structures, and concurrency issues to understand the ideas presented, as well as some experience programming in C/\CC.
    213 Implementers should refer to the \CFA Programming Language Specification for details about the language syntax and semantics.
     210% Implementers should refer to the \CFA Programming Language Specification for details about the language syntax and semantics.
    214211Changes to the syntax and additional features are expected to be included in later revisions.
    215212
     
    321318\end{comment}
    322319
    323 However, it is necessary to differentiate between C and \CFA code because of name \Index{overload}ing, as for \CC.
     320As for \CC, it is necessary to differentiate between C and \CFA code because of name \Index{overload}ing.
    324321For example, the C math-library provides the following routines for computing the absolute value of the basic types: ©abs©, ©labs©, ©llabs©, ©fabs©, ©fabsf©, ©fabsl©, ©cabsf©, ©cabs©, and ©cabsl©.
    325322Whereas, \CFA wraps these routines into one overloaded name ©abs©:
     
    338335The problem is a \Index{name clash} between the C name ©abs© and the \CFA names ©abs©, resulting in two name linkages\index{C linkage}: ©extern "C"© and ©extern "Cforall"© (default).
    339336Overloaded names must use \newterm{name mangling}\index{mangling!name} to create unique names that are different from unmangled C names.
    340 Hence, there is the same need as in \CC to know if a name is a C or \CFA name, so it can be correctly formed.
     337Hence, there is the same need, as in \CC, to know if a name is a C or \CFA name, so it can be correctly formed.
    341338The only way around this problem is C's approach of creating unique names for each pairing of operation and type.
    342339
     
    349346\section{\CFA Compilation}
    350347
    351 \CFA is a \newterm{transpiler}, meaning it reads in a programming language (\CFA) as input and generates another programming language (C) as output, whereas a \newterm{compiler} reads in a programming language and generates assembler/machine code.
    352 Hence, \CFA is like the C preprocessor modifying a program and sending it on to another step for further transformation.
     348\CFA is currently a \newterm{transpiler}, meaning it reads in a programming language (\CFA) as input and generates another programming language (C) as output, whereas a \newterm{compiler} reads in a programming language and generates assembler/machine code.
     349Hence, \CFA is like the C preprocessor modifying a program and sending it onto another step for further transformation.
    353350The order of transformation is C preprocessor, \CFA, and finally GNU C compiler, which also has a number of transformation steps, such as assembler and linker.
    354351
     
    359356There is no ordering among options (flags) and files, unless an option has an argument, which must appear immediately after the option possibly with or without a space separating option and argument.
    360357
    361 \CFA has the following ©gcc© flags turned on:
    362 \begin{description}[topsep=0pt]
     358\CFA turns on the following ©gcc© flags.
     359\begin{description}
    363360\item
    364361\Indexc{-std=gnu11}\index{compilation option!-std=gnu11@{©-std=gnu11©}}
     
    366363\end{description}
    367364
    368 \CFA has the following new options:
    369 \begin{description}[topsep=0pt]
     365\CFA adds the following new flags, where prefixing with ©"no"© negates the meaning of the flag.
     366\begin{description}[leftmargin=*,itemsep=0pt]
     367\item
     368\Indexc{-help}\index{compilation option!-help@©-help©}
     369Information about the set of \CFA compilation flags is printed.
     370
     371\item
     372\Indexc{-nohelp}\index{compilation option!-nohelp@©-nohelp©}
     373Information about the set of \CFA compilation flags is not printed.
     374\textbf{This option is the default.}
     375
    370376\item
    371377\Indexc{-CFA}\index{compilation option!-CFA@©-CFA©}
     
    387393\Indexc{-nodebug}\index{compilation option!-nodebug@©-nodebug©}
    388394The program is linked with the non-debugging version of the runtime system, so the execution of the program is faster.
    389 \Emph{However, no runtime checks or ©assert©s are performed so errors usually result in abnormal program behaviour or termination.}
    390 
    391 \item
    392 \Indexc{-help}\index{compilation option!-help@©-help©}
    393 Information about the set of \CFA compilation flags is printed.
    394 
    395 \item
    396 \Indexc{-nohelp}\index{compilation option!-nohelp@©-nohelp©}
    397 Information about the set of \CFA compilation flags is not printed.
    398 \textbf{This option is the default.}
    399395
    400396\item
     
    457453\end{lstlisting}
    458454Alternatively, multiple flags can be specified separated with commas and \emph{without} spaces.
    459 \begin{lstlisting}[language=sh,{moredelim=**[is][\protect\color{red}]{®}{®}}]
     455\begin{lstlisting}[language=sh,escapechar=§,{moredelim=**[is][\protect\color{red}]{®}{®}}]
    460456cfa §test§.cfa -XCFA®,®-Pparse®,®-n # show program parse without prelude
    461457\end{lstlisting}
     
    504500\item
    505501\Indexc{excpdecl}\index{transpiler option!-P@{©-P©}!©excpdecl©}\index{transpiler option!--print@{©-print©}!©excpdecl©} \, print AST after translating exception decls
    506 \item
    507 \Indexc{symevt}\index{transpiler option!-P@{©-P©}!©symevt©}\index{transpiler option!--print@{©-print©}!©symevt©} \, print AST after symbol table events
    508 \item
    509 \Indexc{expralt}\index{transpiler option!-P@{©-P©}!©expralt©}\index{transpiler option!--print@{©-print©}!©expralt©} \, print AST after expressions alternatives
    510 \item
    511 \Indexc{valdecl}\index{transpiler option!-P@{©-P©}!©valdecl©}\index{transpiler option!--print@{©-print©}!©valdecl©} \, print AST after declaration validation pass
     502% \item
     503% \Indexc{symevt}\index{transpiler option!-P@{©-P©}!©symevt©}\index{transpiler option!--print@{©-print©}!©symevt©} \, print AST after symbol table events
     504% \item
     505% \Indexc{expralt}\index{transpiler option!-P@{©-P©}!©expralt©}\index{transpiler option!--print@{©-print©}!©expralt©} \, print AST after expressions alternatives
     506\item
     507\Indexc{validecl}\index{transpiler option!-P@{©-P©}!©validecl©}\index{transpiler option!--print@{©-print©}!©validecl©} \, print AST after declaration validation pass
    512508\item
    513509\Indexc{bresolver}\index{transpiler option!-P@{©-P©}!©bresolver©}\index{transpiler option!--print@{©-print©}!©bresolver©} \, print AST before resolver step
    514510\item
    515 \Indexc{expranly}\index{transpiler option!-P@{©-P©}!©expranly©}\index{transpiler option!--print@{©-print©}!©expranly©} \, print AST after expression analysis
     511\Indexc{expranl}\index{transpiler option!-P@{©-P©}!©expranl©}\index{transpiler option!--print@{©-print©}!©expranl©} \, print AST after expression analysis
    516512\item
    517513\Indexc{ctordtor}\index{transpiler option!-P@{©-P©}!©ctordtor©}\index{transpiler option!--print@{©-print©}!©ctordtor©} \, print AST after ctor/dtor are replaced
     
    605601Exponentiation, $x^y$, means raise $x$ to the $y$th power.
    606602When $y$ is a positive integer, exponentiation corresponds to $\prod_{i=1}^{y} x$.
    607 
    608603C, \CC, Java and other programming languages have no exponentiation operator\index{exponentiation!operator}\index{operator!exponentiation}, using a routine like \Indexc{pow( x, y )} instead.
    609604Ada, Haskell, Python and other programming languages have an exponentiation operator often using operators ©^© or ©**©.
     
    645640\subsection{\texorpdfstring{\LstKeywordStyle{if} / \LstKeywordStyle{while} Statement}{if / while Statement}}
    646641
    647 The \Indexc{if} and \Indexc{while} expressions are extended with declarations, similar to the \Indexc{for} declaration expression.\footnote{
    648 Declarations in the \Indexc{do}-©while© condition are not useful because they appear after the loop body.}
     642The \Indexc{if} and \Indexc{while} expressions are extended with declarations, similar to the \Indexc{for} declaration expression.
     643Note, declarations in the \Indexc{do}-©while© condition are not useful because they appear after the loop body.
    649644\begin{cfa}
    650645if ( ®int x = f()® ) ...                        §\C[2.75in]{// x != 0}§
     
    755750
    756751C allows a number of questionable forms for the \Indexc{switch} statement:
    757 \begin{enumerate}
     752\begin{enumerate}[leftmargin=*]
    758753\item
    759754By default, the end of a \Indexc{case} clause\footnote{
     
    881876The key observation is that the ©switch© statement branches into a control structure, \ie there are multiple entry points into its statement body.
    882877\end{enumerate}
    883 
    884878Before discussing language changes to deal with these problems, it is worth observing that in a typical C program:
    885879\begin{itemize}
     
    893887and there is only a medium amount of fall-through from one ©case© clause to the next, and most of these result from a list of case values executing common code, rather than a sequence of case actions that compound.
    894888\end{itemize}
     889
    895890These observations put into perspective the \CFA changes to the ©switch© statement.
    896 \begin{enumerate}
     891\begin{enumerate}[leftmargin=*]
    897892\item
    898893Eliminating default fall-through has the greatest potential for affecting existing code.
     
    10151010To simplify creating an infinite loop, the \Indexc{for}, \Indexc{while}, and \Indexc{do} loop-predicate\index{loop predicate} is extended with an empty conditional, meaning a comparison value of ©1© (true).
    10161011\begin{cfa}
    1017 while ( )                               §\C{// while ( true )}§
    1018 for ( )                                 §\C{// for ( ; true; )}§
    1019 do ... while ( )                §\C{// do ... while ( true )}§
    1020 \end{cfa}
    1021 
    1022 Looping a predefined number of times, possibly with a loop index, occurs frequently.
    1023 The ©for© control\index{for control}, \ie ©for ( /* control */ )©, is extended with a range and step.
    1024 A range is a set of values defined by an optional low value (default to 0), tilde, and high value, ©L ~ H©, with an optional step ©~ S© (default to 1), which means an ascending set of values from ©L© to ©H© in positive steps of ©S©.
    1025 \begin{cfa}
    1026 0 ~ 5                                                                   §\C{// \{ 0, 1, 2, 3, 4, 5 \}}§
    1027 -8 ~ -2 ~ 2                                                             §\C{// \{ -8. -6, -4, -2 \}}§
    1028 -3 ~ 3 ~ 1                                                              §\C{// \{ -3, -2, -1, 0, 1, 2, 3 \}}§
    1029 \end{cfa}
    1030 \R{Warning}: A range in descending order, \eg ©5 ~ -3© is the null (empty) set, \ie no values in the set.
    1031 As well, a ©0© or negative step is undefined.
    1032 
    1033 The range character, ©'~'©, is decorated on the left and right to control how the set values are presented in the loop body.
    1034 The range character can be prefixed with ©'+'© or ©'-'© indicating the \emph{direction} the range is scanned, \ie from left to right (ascending) or right to left (descending).
    1035 Ascending uses operator \Indexc{+=};
    1036 descending uses operator \Indexc{-=}.
    1037 If there is no prefix character, it defaults to ©'+'©.
    1038 \begin{cfa}
    1039 -8 ®§\Sp§®~ -2                                                  §\C{// ascending, no prefix}§
    1040 0 ®+®~ 5                                                                §\C{// ascending, prefix}§
    1041 -3 ®-®~ 3                                                               §\C{// descending, prefix}§
    1042 \end{cfa}
    1043 For descending iteration, the ©L© and ©H© values are \emph{implicitly} switched, and the increment/decrement for ©S© is toggled.
    1044 Hence, the order of values in a set may not be the order the values are presented during looping.
    1045 Changing the iteration direction is faster and safer because the direction prefix can be added/removed without changing existing (correct) range information.
    1046 \R{Warning}: reversing the range endpoints for descending order results in an empty set.
    1047 \begin{cfa}
    1048 for ( i; ®10 -~ 1® )                                    §{\C{// WRONG descending range!}§
    1049 \end{cfa}
    1050 
    1051 Because C uses zero origin, most loops iterate from 0 to $N - 1$.
    1052 Hence, when scanning a range during iteration, the last value is dropped, \eg ©0 ~ 5© is ©0, 1, 2, 3, 4©, an exclusive range, [©L©,©H©\R{)}.
    1053 To obtain \emph{all} the values in the range, the range character is postfixed with ©'='©, \eg ©0 ~= 5© is ©0, 1, 2, 3, 4, 5©, an inclusive range, [©L©,©H©\R{]}.
    1054 \index{\~}\index{ascending exclusive range}
    1055 \index{\~=}\index{ascending inclusive range}
    1056 \index{-\~}\index{descending exclusive range}
    1057 \index{-\~=}\index{descending inclusive range}
    1058 
    1059 \begin{comment}
    1060 To simplify loop iteration a range is provided, from low to high, and a traversal direction, ascending (©+©) or descending (©-©).
    1061 The following is the syntax for the loop range, where ©[©\,©]© means optional.
    1062 \begin{cfa}[deletekeywords=default]
    1063 [ ®index ;® ] [ [ ®min® (default 0) ] [ direction ®+®/®-® (default +) ] ®~® [ ®=® (include endpoint) ] ] ®max® [ ®~ increment® ]
    1064 \end{cfa}
    1065 For ©=©, the range includes the endpoint (©max©/©min©) depending on the direction (©+©/©-©).
    1066 \end{comment}
    1067 
    1068 ©for© control is formalized by the following regular expression:
     1012while ( )                                                               §\C{// while ( true )}§
     1013for ( )                                                                 §\C{// for ( ; true; )}§
     1014do ... while ( )                                                §\C{// do ... while ( true )}§
     1015\end{cfa}
     1016
     1017The ©for© loop is the primary mechanism for iterating a predefined number of times.
     1018The basic C ©for© loop requires multiple parts, even though most are unnecessary, \eg interating 5 times provides multiple places for errors.
     1019\begin{cfa}
     1020for ( ®int i = 0; i < 5; i += 1® ) ...
     1021\end{cfa}
     1022\CFA simplifies the ©for©-control\index{for control} by defining an integral set of values and specifying if the set is traversed forward or backward.
     1023A range is a set of values defined by an optional low value (0 default) and high value, with an optional step ©S© (1 default) seperated by tildes, ©[L ~] H [~ S]©, where ©[©\,©]© implies optional.
     1024For example, the set ©0 ~ 5 ~ 1© is the set of values 0, 1, 2, 3, 4, 5, which can be travered either direction.
     1025Hence, iterating 5 times can be written succinctly as:
     1026\begin{cfa}
     1027for ( 5 ) ...                                                   §\C{// 0 \textasciitilde\ 5 \textasciitilde\ 1}§
     1028for ( 0 ~ 5 ) ...                                               §\C{// 0 \textasciitilde\ 5 \textasciitilde\ 1}§
     1029for ( 0 ~ 5 ~ 1 ) ...                                   §\C{// 0 \textasciitilde\ 5 \textasciitilde\ 1}§
     1030\end{cfa}
     1031To indicate the scanned direction, the middle tilde is prefixed with ©'+'© or ©'-'©, for forward or backwards, respectively;
     1032no prefix character, defaults to ©'+'©, as above.
     1033\begin{cfa}
     1034for ( ®+®~ 5 ) ...                                              §\C{// forward}§
     1035for ( ®-®~ 5 ) ...                                              §\C{// backward}§
     1036for ( 0 ®+®~ 5 ) ...                                    §\C{// forward}§
     1037for ( 0 ®-®~ 5 ) ...                                    §\C{// backward}§
     1038for ( 0 ®+®~ 5 ~ 1 ) ...                                §\C{// forward}§
     1039for ( 0 ®-®~ 5 ~ 1 ) ...                                §\C{// backward}§
     1040\end{cfa}
     1041\R{Warning}: the expression ©~5© (no prefix), has a preexisting meaning in C: complement the bits of ©5©, means ©for ( -6 )©, as ©-6© is the complement of ©5©.
     1042This anomaly is unlikely to cause problems because programers should write the shorter ©for ( 5 )©.
     1043Hence, for descending iteration, the ©L© and ©H© values are \emph{implicitly} switched, and the increment/decrement for ©S© is toggled from add to subtract.
     1044Using a direction prefix rather than switching the low and high values is faster and safer because the prefix is added/removed without changing existing (correct) range information.
     1045A consequence of of the direction prefix is that the range, \eg ©5 ~ 0© is the null (empty) set, as there are no values in the range ©5© to ©0©.
     1046As well, a ©0© or negative step generates an infinite or large range (finite integers), as it does in C.
     1047\begin{cfa}
     1048-3 ~ 3 ~ ®0®                                                    §\C{// infinite: -3, -3, -3, ... }§
     1049-3 ~ 3 ~ ®-1®                                                   §\C{// large: -3, -4, -5, ..., 2, 3}§
     1050-3 -~ 3 ~ ®-1®                                                  §\C{// large: 3, 4, 5, ..., -2, -3}§
     1051\end{cfa}
     1052Finally, C uses zero origin, so most loops iterate from 0 to $N - 1$.
     1053To match this idiom, a range used for iteration, drops the last value, \eg ©0 ~ 5© is actually ©0, 1, 2, 3, 4©, \ie an exclusive range, [©L©,©H©\R{)}.
     1054To obtain the inclusive range, [©L©,©H©\R{]}, the middle titlde is postfixed with ©'='©, \eg ©0 ~= 5© is ©0, 1, 2, 3, 4, 5©.
     1055\index{\~}\index{ascending exclusive range}%
     1056\index{\~=}\index{ascending inclusive range}%
     1057\index{-\~}\index{descending exclusive range}%
     1058\index{-\~=}\index{descending inclusive range}%
     1059The following is the complete regular expression for ©for©-control:
    10691060\begin{cquote}
    10701061[ ©L© ]\ \ [ ©+©\ \ |\ \ ©-© ]\ \ \R{©~©}\ \ [ ©=© ]\ \ ©H©\ \ [ ©~© ©S© ]
    10711062\end{cquote}
    10721063where ©[©\,©]© denotes optional and ©|© denotes alternative.
    1073 That is, the optional low set value, the optional scan direction (ascending/descending), the (possibly) required range character, the optional include last-scan value, the required high set value, and the optional range character and step value.
    1074 \R{Warning}: the regular expression allows the form ©~H©, but this syntax has a preexisting meaning in C: complement the bits of ©H©, \eg ©for ( ~5 )© meaning ©for ( -6 )©, as ©-6© is the complement of ©5©.
    1075 This anomaly is unlikely to cause problems because programers should write the shorter ©for ( 5 )©.
    1076 
    1077 The previous ©for© loops have an anonymous loop index in which the range iteration is computed.
    1078 To access the value of the range iteration in the loop body, a \Index{loop index} is specified before the range.
    1079 \begin{cfa}
    1080 for ( ®int i;® 0 ~ 10 ~ 2 ) { ... ®i® ... }     §\C{// loop index available in loop body}§
    1081 \end{cfa}
    1082 Hence, unlike the 3 components in the C ©for©-control, there are only two components in the \CFA ©for©-control: the optional index variable and the range.
    1083 The index type is optional (like \CC ©auto©), where the type is normally inferred from the low value ©L© because it initializes the index (the type of ©H© can be different from ©L©).
    1084 When ©L© is omitted, the type of the required high value ©H© is used, as both ©L© and ©H© are the same type in this case.
     1064%That is, the optional low set value, the optional scan direction (ascending/descending), the (possibly) required range character, the optional include last-scan value, the required high set value, and the optional range character and step value.
     1065
     1066To add a \Index{loop index}, the ©for©-control is prefixed with a variable or variable declaration.
     1067\begin{cfa}
     1068for ( ®i;® ®0L® ~ 10 ~ 2 ) { ... ®i® ... }      §\C{// implicitly typed index, typeof(0L) is long int}§
     1069for ( ®long int i;® 0 ~ 10 ~ 2 ) { ... ®i® ... } §\C{// explicitly typed index}§
     1070\end{cfa}
     1071Hence, there are only two components in the \CFA ©for©-control \vs 3 in C.
     1072If the index is untyped, it is inferred from the low value ©L© because it initializes the index (the type of ©H© can be different from ©L©).
     1073When ©L© is omitted, the type of ©H© is used, as both ©L© and ©H© are the same type in this case.
    10851074\begin{cfa}
    10861075for ( i; ®1.5® ~ 5 )                                    §\C{// typeof(1.5) i; 1.5 is low value}§
    10871076for ( i; ®5.5® )                                                §\C{// typeof(5.5) i; 5.5 is high value}§
    10881077\end{cfa}
    1089 
     1078This semantics is the same as \CC ©auto© for declaring the loop index.
     1079\begin{C++}
     1080for ( auto i = 0; i < 1.5; i += 5 )
     1081\end{C++}
     1082
     1083\begin{comment}
    10901084The following examples illustrate common \CFA ©for©-control combinations, with the C counter-part in the comment.
    10911085\begin{itemize}[itemsep=0pt]
     
    11211115\end{cfa}
    11221116\end{itemize}
    1123 
    1124 There are situations when the ©for©-control actions need to be moved into the loop body, \eg a mid-loop exit does not need an iteration-completion test in the ©for© control.
    1125 The character ©'@'© indicates that a specific ©for©-control action is ignored, \ie generates no code.
     1117\end{comment}
     1118
     1119There are also situations when the ©for©-control actions need to be moved into the loop body, \eg a mid-loop exit does not need an iteration-completion test in the ©for©-control.
     1120The character ©'@'© indicates a specific ©for©-control action is elided, \ie generates no code.
    11261121\begin{cfa}
    11271122for ( i; ®@® -~ 10 )                                    §\C{// for ( typeof(10) i = 10; \R{/*empty*/}; i -= 1 )}§
     
    11311126\end{cfa}
    11321127\R{Warning}: ©L© \emph{cannot} be elided for the ascending range, \lstinline{@ ~ 5}, nor ©H© for the descending range, \lstinline{1 -~ @}, as the loop index is uninitialized.
    1133 \R{Warning}: ©H© \emph{cannot} be elided in an anonymous loop index, ©1 ~ @©, as there is no index to stop the loop.
     1128As well, ©H© \emph{cannot} be elided in an anonymous loop index, ©1 ~ @©, as there is no index to stop the loop.
    11341129
    11351130There are situations when multiple loop indexes are required.
    1136 The character ©':'© means add another index, where any number of indices may be chained in a single ©for© control.
     1131The character ©':'© is used to add another index, where any number of indices may be chained in a single ©for©-control.
    11371132\begin{cfa}
    11381133for ( i; 5  ®:®  j; 2 ~ 12 ~ 3 )                §\C{// for ( typeof(i) i = 1, j = 2; \R{i < 5 \&\& j < 12}; i += 1, j += 3 )}§
     
    12461241\end{figure}
    12471242
    1248 Finally, any type that satisfies the ©Iterate© trait can be used with ©for© control.
     1243Finally, any type that satisfies the ©Iterate© trait can be used with ©for©-control.
    12491244\begin{cfa}
    12501245forall( T ) trait Iterate {
     
    12601255}
    12611256\end{cfa}
    1262 \VRef[Figure]{f:ForControlStructureType} shows an example of a structure using ©for© control.
     1257\VRef[Figure]{f:ForControlStructureType} shows an example of a structure using ©for©-control.
    12631258Note, the use of ©(S){0}© when implicitly setting the loop-index type, because using 0 incorrect declares the index to ©int© rather than ©S©.
    12641259
     
    14901485\end{cfa}
    14911486Repeated aggregate qualification is tedious and makes code difficult to read.
    1492 Therefore, reducing aggregate qualification is a useful language design goal.
     1487Therefore, reducing aggregate qualification is a useful design goal.
    14931488
    14941489C partially addresses the problem by eliminating qualification for enumerated types and unnamed \emph{nested} aggregates, which open their scope into the containing aggregate.
     
    14961491\begin{cfa}
    14971492struct S {
    1498         struct §\R{\LstCommentStyle{/* unnamed */}}§ { int g,  h; } __attribute__(( aligned(64) ));
     1493        struct ®/* unnamed */® { int g,  h; } __attribute__(( aligned(64) ));
    14991494        int tag;
    1500         union §\R{\LstCommentStyle{/* unnamed */}}§  {
     1495        union ®/* unnamed */®  {
    15011496                struct { char c1,  c2; } __attribute__(( aligned(128) ));
    15021497                struct { int i1,  i2; };
Note: See TracChangeset for help on using the changeset viewer.