Changes in / [615767b:dd53f75]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/fangren_yu_COOP_S20/Report.tex
r615767b rdd53f75 1 \documentclass[twoside,1 1pt]{article}1 \documentclass[twoside,12pt]{article} 2 2 3 3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% … … 11 11 \usepackage[labelformat=simple,aboveskip=0pt,farskip=0pt]{subfig} 12 12 \renewcommand{\thesubfigure}{\alph{subfigure})} 13 \usepackage[flushmargin]{footmisc} % support label/reference in footnote14 13 \usepackage{latexsym} % \Box glyph 15 14 \usepackage{mathptmx} % better math font with "times" 16 \usepackage [toc]{appendix} % article does not have appendix15 \usepackage{appendix} 17 16 \usepackage[usenames]{color} 18 17 \input{common} % common CFA document macros … … 382 381 \subsubsection{Source: \lstinline{AST/SymbolTable.hpp}} 383 382 383 384 \subsubsection{Source: \lstinline{SymTab/Indexer.h}} 385 384 386 Function 385 387 \begin{C++} … … 610 612 611 613 612 \ appendix614 \begin{appendices}[toc,titletoc] 613 615 \section{Appendix} 616 614 617 615 618 \subsection{Kinds of Type Parameters} 616 619 \label{s:KindsTypeParameters} 617 620 618 A type parameter in a @forall@ clause has 3kinds:621 A type parameter in a @forall@ clause has three possible kinds: 619 622 \begin{enumerate}[listparindent=0pt] 620 623 \item 621 @dtype@: any data type (built-in or user defined) that is not a concrete type. 622 623 A non-concrete type is an incomplete type such as an opaque type or pointer/reference with an implicit (pointer) size and implicitly generated reference and dereference operations. 624 \item 625 @otype@: any data type (built-in or user defined) that is concrete type. 626 627 A concrete type is a complete type, \ie types that can be used to create a variable, which also implicitly asserts the existence of default and copy constructors, assignment, and destructor\footnote{\CFA implements the same automatic resource management (RAII) semantics as \CC.}. 628 % \item 629 % @ftype@: any function type. 630 % 631 % @ftype@ provides two purposes: 632 % \begin{itemize} 633 % \item 634 % Differentiate function pointer from data pointer because (in theory) some systems have different sizes for these pointers. 635 % \item 636 % Disallow a function pointer to match an overloaded data pointer, since variables and functions can have the same names. 637 % \end{itemize} 624 @dtype@: any data type (built-in or user defined). 625 626 There is also a difference between opaque types (incomplete types, \ie those with only a forward declaration) and concrete types. 627 Only concrete types can be directly used as a variable type. 628 629 \CFA provides the @otype@ shorthand to require a type parameter be concrete, which also implicitly asserts the existence of its default and copy constructors, assignment, and destructor\footnote{\CFA implements the same automatic resource management (RAII) semantics as \CC.}. 630 \item 631 @ftype@: any function type. 632 633 @ftype@ provides two purposes: 634 \begin{itemize} 635 \item 636 Differentiate function pointer from data pointer because (in theory) some systems have different sizes for these pointers. 637 \item 638 Disallow a function pointer to match an overloaded data pointer, since variables and functions can have the same names. 639 \end{itemize} 638 640 639 641 \item 640 642 @ttype@: tuple (variadic) type. 641 643 642 Restricted to the type for the last parameter in a function,it provides a type-safe way to implement variadic functions.644 @ttype@ parameter may only appear as type of the last parameter in a function, and it provides a type-safe way to implement variadic functions. 643 645 Note however, that it has certain restrictions, as described in the implementation section below. 644 646 \end{enumerate} … … 671 673 \begin{enumerate} 672 674 \item 673 All types , variables, and functions are candidates of implicit parameters675 All types are function declarations are candidates of implicit parameters. 674 676 \item 675 677 The parameter (assertion) name must match the actual declarations. 678 \item 679 Currently, assertions are all functions. 680 Note that since \CFA has variable overloading, implicit value parameters might also be supported in the future. 676 681 \end{enumerate} 677 682 … … 727 732 In particular, polymorphic variadic recursion must be structural (\ie the number of arguments decreases in any possible recursive calls), otherwise code generation gets into an infinite loop. 728 733 The \CFA compiler sets a limit on assertion depth and reports an error if assertion resolution does not terminate within the limit (as for \lstinline[language=C++]@templates@ in \CC). 734 \end{appendices} 729 735 730 736 \bibliographystyle{plain}
Note: See TracChangeset
for help on using the changeset viewer.