Changeset 2d831a1 for doc/theses/colby_parsons_MMAth/text/CFA_intro.tex
- Timestamp:
- May 8, 2023, 4:53:10 PM (18 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 84018e0
- Parents:
- c0527f8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/colby_parsons_MMAth/text/CFA_intro.tex
rc0527f8 r2d831a1 10 10 Beyond C, it adds productivity features, extended libraries, an advanced type-system, and many control-flow/concurrency constructions. 11 11 However, \CFA stays true to the C programming style, with most code revolving around @struct@'s and routines, and respects the same rules as C. 12 \CFA is not object oriented as it has no notion of @this@ (receiver) and no structures with methods, but supports some object oriented ideas including constructors, destructors, and limited containmentinheritance.12 \CFA is not object oriented as it has no notion of @this@ (receiver) and no structures with methods, but supports some object oriented ideas including constructors, destructors, and limited nominal inheritance. 13 13 While \CFA is rich with interesting features, only the subset pertinent to this work is discussed. 14 14 … … 128 128 \section{Polymorphism}\label{s:poly} 129 129 C supports limited polymorphism, often requiring users to implement polymorphism using a @void *@ (type erasure) approach. 130 \CFA extends C with generalized overloading polymorphism (see \VRef{s:Overloading}), as well as, parametric polymorphism and limited containmentinheritance.130 \CFA extends C with generalized overloading polymorphism (see \VRef{s:Overloading}), as well as, parametric polymorphism and limited nominal inheritance. 131 131 132 132 \subsection{Parametric Polymorphism} … … 180 180 181 181 \subsection{Inheritance} 182 Inheritance in \CFA is taken from Plan-9 C's containmentinheritance.182 Inheritance in \CFA is taken from Plan-9 C's nominal inheritance. 183 183 In \CFA, @struct@s can @inline@ another struct type to gain its fields and masquerade as that type. 184 Examples of \CFA containmentinheritance are shown in \VRef[Listing]{l:cfa_inherit}.185 186 \begin{cfa}[caption={Example of \CFA containmentinheritance},label={l:cfa_inherit}]184 Examples of \CFA nominal inheritance are shown in \VRef[Listing]{l:cfa_inherit}. 185 186 \begin{cfa}[caption={Example of \CFA nominal inheritance},label={l:cfa_inherit}] 187 187 struct one_d { double x; }; 188 188 struct two_d {
Note: See TracChangeset
for help on using the changeset viewer.