Changeset e41c4c6 for doc/theses/colby_parsons_MMAth/text/CFA_intro.tex
- Timestamp:
- Apr 2, 2023, 8:20:16 AM (18 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- fb7cda9
- Parents:
- 1e6cecb (diff), 678c540 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/colby_parsons_MMAth/text/CFA_intro.tex
r1e6cecb re41c4c6 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.