Changeset 20e409e

Ignore:
Timestamp:
Sep 24, 2015, 9:59:20 PM (6 years ago)
Branches:
aaron-thesis, arm-eh, cleanup-dtors, ctor, deferred_resn, demangler, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, string, with_gc
Children:
02e5ab6
Parents:
bfee448
Message:

make *predefined* declarations work

Location:
doc/refrat
Files:
3 edited

Legend:

Unmodified
 rbfee448 clean : rm -f *.bbl *.aux *.dvi *.idx *.ilg *.ind *.brf *.out *.log *.toc *.blg *.pstex_t \ rm -f *.bbl *.aux *.dvi *.idx *.ilg *.ind *.brf *.out *.log *.toc *.blg *.pstex_t *.cf \ ${FIGURES}${PICTURES} ${PROGRAMS}${GRAPHS} ${basename${DOCUMENT}}.ps ${DOCUMENT}${LaTeX} ${basename$@}.tex predefined : sed -f predefined.sed ${basename${DOCUMENT}}.tex > ${basename$@}.cf ## Define the default recipes.
 rbfee448 \subsubsection{Semantics} CFA provides a capability for generic types; using this capability a single "generic type generator" can be written that can represent multiple concrete type instantiations by substitution of the "type parameters" of the generic type for concrete types. Syntactically a generic type generator is represented by putting a forall specifier on a struct or union declaration, as defined in section 6.7.2.5. An instantiation of the generic type is written by specifying the type parameters in parentheses after the name of the generic type generator, as in the following example: \begin{lstlisting} forall( type T ) struct pair { \CFA provides a capability for generic types; using this capability a single "generic type generator" can be written that can represent multiple concrete type instantiations by substitution of the "type parameters" of the generic type for concrete types. Syntactically a generic type generator is represented by putting a forall specifier on a struct or union declaration, as defined in \VRef{forall}. An instantiation of the generic type is written by specifying the type parameters in parentheses after the name of the generic type generator: \begin{lstlisting} forall( type T | sumable( T ) ) struct pair { T x; T y; }; pair( int ) p = { 3, 14 }; \end{lstlisting} The type parameters in an instantiation of a generic type must satisfy any constraints in the forall specifier on the type generator declaration. The instantiation then has the semantics that would result if the type parameters were substituted into the type generator declaration by macro substitution. specifier on the type generator declaration, e.g., \lstinline$sumable$. The instantiation then has the semantics that would result if the type parameters were substituted into the type generator declaration by macro substitution. Polymorphic functions may have generic types as parameters, and those generic types may use type parameters of the polymorphic function as type parameters of the generic type, as in the following example: parameters of the polymorphic function as type parameters of the generic type: \begin{lstlisting} forall( type T ) void swap( pair(T) *p ) {