# Changeset 86f384b for doc/user

Ignore:
Timestamp:
Jul 2, 2017, 10:49:41 AM (4 years ago)
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
307a732
Parents:
d395012
Message:

make tuple separator a separator rather than terminator

File:
1 edited

### Legend:

Unmodified
 rd395012 %% Created On       : Wed Apr  6 14:53:29 2016 %% Last Modified By : Peter A. Buhr %% Last Modified On : Sat Jul  1 17:19:42 2017 %% Update Count     : 2495 %% Last Modified On : Sun Jul  2 09:49:56 2017 %% Update Count     : 2503 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 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. The approach combines ideas from \CC and Python. The \CFA header file for the I/O library is \Indexc{fstream}. \end{tabular} \end{quote2} The \CFA form has half as many characters as the \CC form, and is similar to \Index*{Python} I/O with respect to implicit separators. Similar simplification occurs for \Index{tuple} I/O, which prints all a tuple's values, each separated by \lstinline[showspaces=true]@, @''. The \CFA form has half the characters of the \CC form, and is similar to \Index*{Python} I/O with respect to implicit separators. Similar simplification occurs for \Index{tuple} I/O, which prints all tuple values separated by \lstinline[showspaces=true]@, @''. \begin{cfa}[mathescape=off,aboveskip=0pt,belowskip=0pt] [int, int] t1 = [1, 2], t2 = [3, 4]; [int, [ int, int ] ] t1 = [ 1, [ 2, 3 ] ], t2 = [ 3, [ 4, 5 ] ]; sout | t1 | t2 | endl;                                  §\C{// print tuples}§ \end{cfa} \begin{cfa}[mathescape=off,showspaces=true,belowskip=0pt] 1®, ®2®, ®3®, ®4 \end{cfa} Finally, \CFA uses the logical-or operator for I/O because it is the lowest-priority overloadable operator, other than assignment. 1®, ®2®, ®3 3®, ®4®, ®5 \end{cfa} Finally, \CFA uses the logical-or operator for I/O as it is the lowest-priority overloadable operator, other than assignment. Therefore, fewer output expressions require parenthesis. \begin{quote2} int x = 1, y = 2, z = 3; sout | x | y | z | endl; [int, int] t1 = [1, 2], t2 = [3, 4]; sout | t1 | t2 | endl;                                          // print tuple [int, [ int, int ] ] t1 = [ 1, [ 2, 3 ] ], t2 = [ 3, [ 4, 5 ] ]; sout | t1 | t2 | endl;                                          // print tuples sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2) | endl; sout | 1 | 2 | 3 | endl;