Changeset 86f384b for doc/user/user.tex


Ignore:
Timestamp:
Jul 2, 2017, 10:49:41 AM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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
Message:

make tuple separator a separator rather than terminator

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/user/user.tex

    rd395012 r86f384b  
    1111%% Created On       : Wed Apr  6 14:53:29 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Sat Jul  1 17:19:42 2017
    14 %% Update Count     : 2495
     13%% Last Modified On : Sun Jul  2 09:49:56 2017
     14%% Update Count     : 2503
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    24332433
    24342434The 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.
     2435The approach combines ideas from \CC and Python.
    24352436The \CFA header file for the I/O library is \Indexc{fstream}.
    24362437
     
    24582459\end{tabular}
    24592460\end{quote2}
    2460 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.
    2461 Similar simplification occurs for \Index{tuple} I/O, which prints all a tuple's values, each separated by ``\lstinline[showspaces=true]@, @''.
     2461The \CFA form has half the characters of the \CC form, and is similar to \Index*{Python} I/O with respect to implicit separators.
     2462Similar simplification occurs for \Index{tuple} I/O, which prints all tuple values separated by ``\lstinline[showspaces=true]@, @''.
    24622463\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 ] ];
    24642465sout | t1 | t2 | endl;                                  §\C{// print tuples}§
    24652466\end{cfa}
    24662467\begin{cfa}[mathescape=off,showspaces=true,belowskip=0pt]
    2467 1®, ®2®, ®3®, ®4
    2468 \end{cfa}
    2469 Finally, \CFA uses the logical-or operator for I/O because it is the lowest-priority overloadable operator, other than assignment.
     24681®, ®2®, ®3 3®, ®4®, ®5
     2469\end{cfa}
     2470Finally, \CFA uses the logical-or operator for I/O as it is the lowest-priority overloadable operator, other than assignment.
    24702471Therefore, fewer output expressions require parenthesis.
    24712472\begin{quote2}
     
    26602661        int x = 1, y = 2, z = 3;
    26612662        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
    26642665        sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2) | endl;
    26652666        sout | 1 | 2 | 3 | endl;
Note: See TracChangeset for help on using the changeset viewer.