- Timestamp:
- Jul 2, 2017, 10:49:41 AM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 307a732
- Parents:
- d395012
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified doc/user/user.tex ¶
rd395012 r86f384b 11 11 %% Created On : Wed Apr 6 14:53:29 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : S at Jul 1 17:19:42201714 %% Update Count : 2 49513 %% Last Modified On : Sun Jul 2 09:49:56 2017 14 %% Update Count : 2503 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 2433 2433 2434 2434 The goal of \CFA I/O is to simplify the common cases\index{I/O!common case}, while fully supporting polymorphism and user defined types in a consistent way. 2435 The approach combines ideas from \CC and Python. 2435 2436 The \CFA header file for the I/O library is \Indexc{fstream}. 2436 2437 … … 2458 2459 \end{tabular} 2459 2460 \end{quote2} 2460 The \CFA form has half as many characters asthe \CC form, and is similar to \Index*{Python} I/O with respect to implicit separators.2461 Similar simplification occurs for \Index{tuple} I/O, which prints all a tuple's values, eachseparated by ``\lstinline[showspaces=true]@, @''.2461 The \CFA form has half the characters of the \CC form, and is similar to \Index*{Python} I/O with respect to implicit separators. 2462 Similar simplification occurs for \Index{tuple} I/O, which prints all tuple values separated by ``\lstinline[showspaces=true]@, @''. 2462 2463 \begin{cfa}[mathescape=off,aboveskip=0pt,belowskip=0pt] 2463 [int, int] t1 = [1, 2], t2 = [3, 4];2464 [int, [ int, int ] ] t1 = [ 1, [ 2, 3 ] ], t2 = [ 3, [ 4, 5 ] ]; 2464 2465 sout | t1 | t2 | endl; §\C{// print tuples}§ 2465 2466 \end{cfa} 2466 2467 \begin{cfa}[mathescape=off,showspaces=true,belowskip=0pt] 2467 1®, ®2®, ®3 ®, ®42468 \end{cfa} 2469 Finally, \CFA uses the logical-or operator for I/O becauseit is the lowest-priority overloadable operator, other than assignment.2468 1®, ®2®, ®3 3®, ®4®, ®5 2469 \end{cfa} 2470 Finally, \CFA uses the logical-or operator for I/O as it is the lowest-priority overloadable operator, other than assignment. 2470 2471 Therefore, fewer output expressions require parenthesis. 2471 2472 \begin{quote2} … … 2660 2661 int x = 1, y = 2, z = 3; 2661 2662 sout | x | y | z | endl; 2662 [int, int] t1 = [1, 2], t2 = [3, 4];2663 sout | t1 | t2 | endl; // print tuple 2663 [int, [ int, int ] ] t1 = [ 1, [ 2, 3 ] ], t2 = [ 3, [ 4, 5 ] ]; 2664 sout | t1 | t2 | endl; // print tuples 2664 2665 sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2) | endl; 2665 2666 sout | 1 | 2 | 3 | endl;
Note: See TracChangeset
for help on using the changeset viewer.