Changeset 678c540 for doc/theses/colby_parsons_MMAth/text/CFA_intro.tex
- Timestamp:
- Apr 1, 2023, 11:02:26 PM (16 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- e41c4c6
- Parents:
- 75bd041
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/colby_parsons_MMAth/text/CFA_intro.tex
r75bd041 r678c540 11 11 References in \CFA are similar to references in \CC, however in \CFA references are rebindable, and support multi-level referencing. References in \CFA are a layer of syntactic sugar over pointers to reduce the number of ref/deref operations needed with pointer usage. Some examples of references in \CFA are shown in Listing~\ref{l:cfa_ref}. Another related item to note is that the \CFA equivalent of \CC's \code{nullptr} is \code{0p}. 12 12 13 \begin{cfacode}[ tabsize=3,caption={Example of \CFA references},label={l:cfa_ref}]13 \begin{cfacode}[caption={Example of \CFA references},label={l:cfa_ref}] 14 14 int i = 2; 15 15 int & ref_i = i; // declare ref to i … … 32 32 33 33 34 \begin{cfacode}[ tabsize=3,caption={Example of \CFA function overloading},label={l:cfa_overload}]34 \begin{cfacode}[caption={Example of \CFA function overloading},label={l:cfa_overload}] 35 35 int foo() { printf("A\n"); return 0;} 36 36 int foo( int bar ) { printf("B\n"); return 1; }
Note: See TracChangeset
for help on using the changeset viewer.