# Changeset 29c9b23 for doc/theses/andrew_beach_MMath/existing.tex

Ignore:
Timestamp:
Feb 4, 2021, 9:56:11 AM (22 months ago)
Branches:
arm-eh, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
9af0fe2d
Parents:
6a99803
Message:

Andrew MMath: Supposed to be focused on features but it ended up leaking out.

File:
1 edited

### Legend:

Unmodified
 r6a99803 \chapter{\texorpdfstring{\CFA Existing Features}{Cforall Existing Features}} \chapter{\CFA Existing Features} \CFA (C-for-all)~\cite{Cforall} is an open-source project extending ISO C with \section{Reference Type} \CFA adds a rebindable reference type to C, but more expressive than the \CC \CFA adds a rebindable reference type to C, but more expressive than the \Cpp reference.  Multi-level references are allowed and act like auto-dereferenced pointers using the ampersand (@&@) instead of the pointer asterisk (@*@). \CFA Both constructors and destructors are operators, which means they are just functions with special operator names rather than type names in \CC. The functions with special operator names rather than type names in \Cpp. The special operator names may be used to call the functions explicitly (not allowed in \CC for constructors). allowed in \Cpp for constructors). In general, operator names in \CFA are constructed by bracketing an operator matching overloaded destructor @void ^?{}(T &);@ is called.  Without explicit definition, \CFA creates a default and copy constructor, destructor and assignment (like \CC). It is possible to define constructors/destructors for assignment (like \Cpp). It is possible to define constructors/destructors for basic and existing types. \CFA uses parametric polymorphism to create functions and types that are defined over multiple types. \CFA polymorphic declarations serve the same role as \CC templates or Java generics. The parametric'' means the polymorphism is as \Cpp templates or Java generics. The parametric'' means the polymorphism is accomplished by passing argument operations to associate \emph{parameters} at the call site, and these parameters are used in the function to differentiate Note, a function named @do_once@ is not required in the scope of @do_twice@ to compile it, unlike \CC template expansion. Furthermore, call-site inferencing compile it, unlike \Cpp template expansion. Furthermore, call-site inferencing allows local replacement of the most specific parametric functions needs for a call. } \end{cfa} The generic type @node(T)@ is an example of a polymorphic-type usage.  Like \CC The generic type @node(T)@ is an example of a polymorphic-type usage.  Like \Cpp templates usage, a polymorphic-type usage must specify a type parameter.