Changeset 200fcb3 for doc


Ignore:
Timestamp:
Dec 12, 2018, 9:16:12 AM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
5ebb1368
Parents:
3d99498
Message:

add auto newline to sout, change endl to nl

Location:
doc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • doc/papers/concurrency/Paper.tex

    r3d99498 r200fcb3  
    686686        Fib f1, f2;
    687687        for ( int i = 1; i <= 10; i += 1 ) {
    688                 sout | next( f1 ) | next( f2 ) | endl;
     688                sout | next( f1 ) | next( f2 );
    689689        }
    690690}
     
    772772                        sout | "  ";               // separator
    773773                }
    774                 sout | endl;
     774                sout | nl;
    775775        }
    776776}
    777777void ?{}( Format & fmt ) { `resume( fmt );` }
    778778void ^?{}( Format & fmt ) with( fmt ) {
    779         if ( g != 0 || b != 0 ) sout | endl;
     779        if ( g != 0 || b != 0 ) sout | nl;
    780780}
    781781void format( Format & fmt ) {
     
    855855        for ( int i = 0; i < N; i += 1 ) {
    856856                int p1 = random( 100 ), p2 = random( 100 );
    857                 sout | p1 | " " | p2 | endl;
     857                sout | p1 | " " | p2;
    858858                int status = delivery( c, p1, p2 );
    859                 sout | " $" | money | endl | status | endl;
     859                sout | " $" | money | nl | status;
    860860                receipt += 1;
    861861        }
    862862        stop( c );
    863         sout | "prod stops" | endl;
     863        sout | "prod stops";
    864864}
    865865int payment( Prod & prod, int money ) {
     
    895895        int money = 1, receipt;
    896896        for ( ; ! done; ) {
    897                 sout | p1 | " " | p2 | endl | " $" | money | endl;
     897                sout | p1 | " " | p2 | nl | " $" | money;
    898898                status += 1;
    899899                receipt = payment( p, money );
    900                 sout | " #" | receipt | endl;
     900                sout | " #" | receipt;
    901901                money += 1;
    902902        }
    903         sout | "cons stops" | endl;
     903        sout | "cons stops";
    904904}
    905905int delivery( Cons & cons, int p1, int p2 ) {
     
    10991099
    11001100void main(foo & this) {
    1101         sout | "Hello World!" | endl;
     1101        sout | "Hello World!";
    11021102}
    11031103\end{cfa}
     
    11241124
    11251125void hello(/*unused*/ int) {
    1126         sout | "Hello World!" | endl;
     1126        sout | "Hello World!";
    11271127}
    11281128
     
    11411141thread World {};
    11421142void main( World & this ) {
    1143         sout | "World!" | endl;
     1143        sout | "World!";
    11441144}
    11451145int main() {
    11461146        World w`[10]`;                                                  $\C{// implicit forks after creation}$
    1147         sout | "Hello " | endl;                                 $\C{// "Hello " and 10 "World!" printed concurrently}$
     1147        sout | "Hello ";                                        $\C{// "Hello " and 10 "World!" printed concurrently}$
    11481148}                                                                                       $\C{// implicit joins before destruction}$
    11491149\end{cfa}
     
    11931193                total += subtotals[r];                          $\C{// total subtotal}$
    11941194    }
    1195     sout | total | endl;
     1195    sout | total;
    11961196}
    11971197\end{cfa}
     
    21922192        BENCH(
    21932193                for ( size_t i = 0; i < N; i += 1 ) { @resume( c );@ } )
    2194         sout | result`ns | endl;
     2194        sout | result`ns;
    21952195}
    21962196\end{cfa}
     
    22052205        BENCH(
    22062206                for ( size_t i = 0; i < N; i += 1 ) { @yield();@ } )
    2207         sout | result`ns | endl;
     2207        sout | result`ns;
    22082208}
    22092209\end{cfa}
     
    22442244int main() {
    22452245        BENCH( for( size_t i = 0; i < N; i += 1 ) { @do_call( m1/*, m2, m3, m4*/ );@ } )
    2246         sout | result`ns | endl;
     2246        sout | result`ns;
    22472247}
    22482248\end{cfa}
     
    23052305        BENCH( for ( size_t i = 0; i < N; i += 1 ) { @wait( c );@ } );
    23062306        go = 0; // stop other thread
    2307         sout | result`ns | endl;
     2307        sout | result`ns;
    23082308}
    23092309int main() {
     
    23562356        BENCH( for ( size_t i = 0; i < N; i += 1 ) { @waitfor( do_call, m );@ } )
    23572357        go = 0; // stop other thread
    2358         sout | result`ns | endl;
     2358        sout | result`ns;
    23592359}
    23602360int main() {
     
    23912391int main() {
    23922392        BENCH( for ( size_t i = 0; i < N; i += 1 ) { @MyThread m;@ } )
    2393         sout | result`ns | endl;
     2393        sout | result`ns;
    23942394}
    23952395\end{cfa}
  • doc/proposals/flags.md

    r3d99498 r200fcb3  
    6060        ```
    6161        FunFlags f = some_val();
    62         if ( f ) { sout | "f has some flag(s) set" | endl; }
    63         if ( f & FOO ) { sout | "f has FOO set" | endl; }
     62        if ( f ) { sout | "f has some flag(s) set"; }
     63        if ( f & FOO ) { sout | "f has FOO set"; }
    6464        f |= FOO; // set FOO
    6565        f -= FOO; // unset FOO
     
    8888        ```
    8989        FunFlags f = some_val();
    90         if ( f.FOO ) { sout | "f has FOO set" | endl; }
     90        if ( f.FOO ) { sout | "f has FOO set"; }
    9191        f.FOO = true;    // set FOO
    9292        f.FOO = false;   // unset FOO
  • doc/user/user.tex

    r3d99498 r200fcb3  
    1111%% Created On       : Wed Apr  6 14:53:29 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Wed Nov  7 17:00:49 2018
    14 %% Update Count     : 3399
     13%% Last Modified On : Tue Dec 11 23:19:26 2018
     14%% Update Count     : 3400
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    178178int main( void ) {
    179179        int x = 0, y = 1, z = 2;
    180         ®sout | x | y | z | endl;®§\indexc{sout}§
     180        ®sout | x | y | z;®§\indexc{sout}§
    181181}
    182182\end{cfa}
     
    513513Floating exponentiation\index{exponentiation!floating} is performed using \Index{logarithm}s\index{exponentiation!logarithm}, so the base cannot be negative.
    514514\begin{cfa}
    515 sout | 2 ®\® 8u | 4 ®\® 3u | -4 ®\® 3u | 4 ®\® -3 | -4 ®\® -3 | 4.0 ®\® 2.1 | (1.0f+2.0fi) ®\® (3.0f+2.0fi) | endl;
     515sout | 2 ®\® 8u | 4 ®\® 3u | -4 ®\® 3u | 4 ®\® -3 | -4 ®\® -3 | 4.0 ®\® 2.1 | (1.0f+2.0fi) ®\® (3.0f+2.0fi);
    516516256 64 -64 0.015625 -0.015625 18.3791736799526 0.264715-1.1922i
    517517\end{cfa}
     
    591591&
    592592\begin{cfa}
    593 sout | endl;
    594 sout | endl;
    595 sout | endl;
    596 sout | "zero" | endl;
    597 sout | endl;
    598 sout | endl;
    599 sout | endl;
    600 sout | endl;
    601 sout | endl;
    602 sout | endl;
    603 sout | endl;
    604 sout | endl;
    605 sout | endl;
    606 sout | endl;
    607 sout | endl;
    608 sout | endl;
    609 sout | endl | endl;
    610 
    611 sout | endl;
    612 sout | endl;
    613 sout | endl | endl;
    614 
    615 sout | endl;
     593sout | nl;
     594sout | nl;
     595sout | nl;
     596sout | "zero" | nl;
     597sout | nl;
     598sout | nl;
     599sout | nl;
     600sout | nl;
     601sout | nl;
     602sout | nl;
     603sout | nl;
     604sout | nl;
     605sout | nl;
     606sout | nl;
     607sout | nl;
     608sout | nl;
     609sout | nl | nl;
     610
     611sout | nl;
     612sout | nl;
     613sout | nl | nl;
     614
     615sout | nl;
    616616\end{cfa}
    617617&
     
    24592459        int bar( int p ) {
    24602460                ®i® += 1;                               §\C{// dependent on local variable}§
    2461                 sout | ®i® | endl;
     2461                sout | ®i®;
    24622462        }
    24632463        return bar;                                     §\C{// undefined because of local dependence}§
     
    24652465int main() {
    24662466        * [int]( int ) fp = foo();      §\C{// int (* fp)( int )}§
    2467         sout | fp( 3 ) | endl;
     2467        sout | fp( 3 );
    24682468}
    24692469\end{cfa}
     
    32313231\begin{cfa}
    32323232int x = 1, y = 2, z = 3;
    3233 sout | x ®|® y ®|® z | endl;
     3233sout | x ®|® y ®|® z;
    32343234\end{cfa}
    32353235&
     
    32523252\begin{cfa}
    32533253[int, [ int, int ] ] t1 = [ 1, [ 2, 3 ] ], t2 = [ 4, [ 5, 6 ] ];
    3254 sout | t1 | t2 | endl;                                  §\C{// print tuples}§
     3254sout | t1 | t2;                                         §\C{// print tuples}§
    32553255\end{cfa}
    32563256\begin{cfa}[showspaces=true,aboveskip=0pt]
     
    32643264&
    32653265\begin{cfa}
    3266 sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2) | endl;
     3266sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2);
    32673267\end{cfa}
    32683268\\
     
    32903290A separator does not appear at the start or end of a line.
    32913291\begin{cfa}[belowskip=0pt]
    3292 sout | 1 | 2 | 3 | endl;
     3292sout | 1 | 2 | 3;
    32933293\end{cfa}
    32943294\begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    32993299A separator does not appear before or after a character literal or variable.
    33003300\begin{cfa}
    3301 sout | '1' | '2' | '3' | endl;
     3301sout | '1' | '2' | '3';
    33023302123
    33033303\end{cfa}
     
    33063306A separator does not appear before or after a null (empty) C string.
    33073307\begin{cfa}
    3308 sout | 1 | "" | 2 | "" | 3 | endl;
     3308sout | 1 | "" | 2 | "" | 3;
    33093309123
    33103310\end{cfa}
     
    33163316\begin{cfa}[mathescape=off]
    33173317sout | "x (" | 1 | "x [" | 2 | "x {" | 3 | "x =" | 4 | "x $" | 5 | "x £" | 6 | "x ¥"
    3318                 | 7 | "x ¡" | 8 | "x ¿" | 9 | "x «" | 10 | endl;
     3318                | 7 | "x ¡" | 8 | "x ¿" | 9 | "x «" | 10;
    33193319\end{cfa}
    33203320%$
     
    33303330\begin{cfa}[belowskip=0pt]
    33313331sout | 1 | ", x" | 2 | ". x" | 3 | "; x" | 4 | "! x" | 5 | "? x" | 6 | "% x"
    3332                 | 7 | "¢ x" | 8 | "» x" | 9 | ") x" | 10 | "] x" | 11 | "} x" | endl;
     3332                | 7 | "¢ x" | 8 | "» x" | 9 | ") x" | 10 | "] x" | 11 | "} x";
    33333333\end{cfa}
    33343334\begin{cfa}[basicstyle=\tt,showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    33403340A seperator does not appear before or after a C string begining/ending with the \Index*{ASCII} quote or whitespace characters: \lstinline[basicstyle=\tt,showspaces=true]@`'": \t\v\f\r\n@
    33413341\begin{cfa}[belowskip=0pt]
    3342 sout | "x`" | 1 | "`x'" | 2 | "'x\"" | 3 | "\"x:" | 4 | ":x " | 5 | " x\t" | 6 | "\tx" | endl;
     3342sout | "x`" | 1 | "`x'" | 2 | "'x\"" | 3 | "\"x:" | 4 | ":x " | 5 | " x\t" | 6 | "\tx";
    33433343\end{cfa}
    33443344\begin{cfa}[basicstyle=\tt,showspaces=true,showtabs=true,aboveskip=0pt,belowskip=0pt]
     
    33493349If a space is desired before or after one of the special string start/end characters, simply insert a space.
    33503350\begin{cfa}[belowskip=0pt]
    3351 sout | "x (§\color{red}\texttt{\textvisiblespace}§" | 1 | "§\color{red}\texttt{\textvisiblespace}§) x" | 2 | "§\color{red}\texttt{\textvisiblespace}§, x" | 3 | "§\color{red}\texttt{\textvisiblespace}§:x:§\color{red}\texttt{\textvisiblespace}§" | 4 | endl;
     3351sout | "x (§\color{red}\texttt{\textvisiblespace}§" | 1 | "§\color{red}\texttt{\textvisiblespace}§) x" | 2 | "§\color{red}\texttt{\textvisiblespace}§, x" | 3 | "§\color{red}\texttt{\textvisiblespace}§:x:§\color{red}\texttt{\textvisiblespace}§" | 4;
    33523352\end{cfa}
    33533353\begin{cfa}[basicstyle=\tt,showspaces=true,showtabs=true,aboveskip=0pt,belowskip=0pt]
     
    33663366\begin{cfa}[mathescape=off,belowskip=0pt]
    33673367sepSet( sout, ", $" );                                          §\C{// set separator from " " to ", \$"}§
    3368 sout | 1 | 2 | 3 | " \"" | ®sep® | "\"" | endl;
     3368sout | 1 | 2 | 3 | " \"" | ®sep® | "\"";
    33693369\end{cfa}
    33703370%$
     
    33753375\begin{cfa}[belowskip=0pt]
    33763376sepSet( sout, " " );                                            §\C{// reset separator to " "}§
    3377 sout | 1 | 2 | 3 | " \"" | ®sepGet( sout )® | "\"" | endl;
     3377sout | 1 | 2 | 3 | " \"" | ®sepGet( sout )® | "\"";
    33783378\end{cfa}
    33793379\begin{cfa}[showspaces=true,aboveskip=0pt]
     
    33853385strcpy( store, sepGet( sout ) );                          §\C{// copy current separator}§
    33863386sepSet( sout, "_" );                                            §\C{// change separator to underscore}§
    3387 sout | 1 | 2 | 3 | endl;
     3387sout | 1 | 2 | 3;
    33883388\end{cfa}
    33893389\begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    33923392\begin{cfa}[belowskip=0pt]
    33933393sepSet( sout, store );                                          §\C{// change separator back to original}§
    3394 sout | 1 | 2 | 3 | endl;
     3394sout | 1 | 2 | 3;
    33953395\end{cfa}
    33963396\begin{cfa}[showspaces=true,aboveskip=0pt]
     
    34033403\begin{cfa}[belowskip=0pt]
    34043404sepSetTuple( sout, " " );                                       §\C{// set tuple separator from ", " to " "}§
    3405 sout | t1 | t2 | " \"" | ®sepTuple® | "\"" | endl;
     3405sout | t1 | t2 | " \"" | ®sepTuple® | "\"";
    34063406\end{cfa}
    34073407\begin{cfa}[showspaces=true,aboveskip=0pt]
     
    34103410\begin{cfa}[belowskip=0pt]
    34113411sepSetTuple( sout, ", " );                                      §\C{// reset tuple separator to ", "}§
    3412 sout | t1 | t2 | " \"" | ®sepGetTuple( sout )® | "\"" | endl;
     3412sout | t1 | t2 | " \"" | ®sepGetTuple( sout )® | "\"";
    34133413\end{cfa}
    34143414\begin{cfa}[showspaces=true,aboveskip=0pt]
     
    34203420Manipulators \Indexc{sepDisable}\index{manipulator!sepDisable@©sepDisable©} and \Indexc{sepEnable}\index{manipulator!sepEnable@©sepEnable©} \emph{globally} toggle printing the separator, \ie the seperator is adjusted with respect to all subsequent printed items.
    34213421\begin{cfa}[belowskip=0pt]
    3422 sout | sepDisable | 1 | 2 | 3 | endl;           §\C{// globally turn off implicit separator}§
     3422sout | sepDisable | 1 | 2 | 3                §\C{// globally turn off implicit separator}§
    34233423\end{cfa}
    34243424\begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    34263426\end{cfa}
    34273427\begin{cfa}[belowskip=0pt]
    3428 sout | sepEnable | 1 | 2 | 3 | endl;            §\C{// globally turn on implicit separator}§
     3428sout | sepEnable | 1 | 2 | 3;           §\C{// globally turn on implicit separator}§
    34293429\end{cfa}
    34303430\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    34353435Manipulators \Indexc{sepOn}\index{manipulator!sepOn@©sepOn©} and \Indexc{sepOff}\index{manipulator!sepOff@©sepOff©} \emph{locally} toggle printing the separator, \ie the seperator is adjusted only with respect to the next printed item.
    34363436\begin{cfa}[belowskip=0pt]
    3437 sout | 1 | sepOff | 2 | 3 | endl;                       §\C{// locally turn off implicit separator}§
     3437sout | 1 | sepOff | 2 | 3;                      §\C{// locally turn off implicit separator}§
    34383438\end{cfa}
    34393439\begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    34413441\end{cfa}
    34423442\begin{cfa}[belowskip=0pt]
    3443 sout | sepDisable | 1 | sepOn | 2 | 3 | endl; §\C{// locally turn on implicit separator}§
     3443sout | sepDisable | 1 | sepOn | 2 | 3; §\C{// locally turn on implicit separator}§
    34443444\end{cfa}
    34453445\begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    34483448The tuple separator also responses to being turned on and off.
    34493449\begin{cfa}[belowskip=0pt]
    3450 sout | t1 | sepOff | t2 | endl;                         §\C{// locally turn on/off implicit separator}§
     3450sout | t1 | sepOff | t2;                                §\C{// locally turn on/off implicit separator}§
    34513451\end{cfa}
    34523452\begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    34563456use ©sep© to accomplish this functionality.
    34573457\begin{cfa}[belowskip=0pt]
    3458 sout | sepOn | 1 | 2 | 3 | sepOn | endl ;       §\C{// sepOn does nothing at start/end of line}§
     3458sout | sepOn | 1 | 2 | 3 | sepOn;       §\C{// sepOn does nothing at start/end of line}§
    34593459\end{cfa}
    34603460\begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    34623462\end{cfa}
    34633463\begin{cfa}[belowskip=0pt]
    3464 sout | sep | 1 | 2 | 3 | sep | endl ;           §\C{// use sep to print separator at start/end of line}§
     3464sout | sep | 1 | 2 | 3 | sep ;          §\C{// use sep to print separator at start/end of line}§
    34653465\end{cfa}
    34663466\begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    34753475int main( void ) {
    34763476        int x = 1, y = 2, z = 3;
    3477         sout | x | y | z | endl;
     3477        sout | x | y | z;
    34783478        [int, [ int, int ] ] t1 = [ 1, [ 2, 3 ] ], t2 = [ 4, [ 5, 6 ] ];
    3479         sout | t1 | t2 | endl;                                          // print tuples
    3480         sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2) | endl;
    3481         sout | 1 | 2 | 3 | endl;
    3482         sout | '1' | '2' | '3' | endl;
    3483         sout | 1 | "" | 2 | "" | 3 | endl;
     3479        sout | t1 | t2;                                         // print tuples
     3480        sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2);
     3481        sout | 1 | 2 | 3;
     3482        sout | '1' | '2' | '3';
     3483        sout | 1 | "" | 2 | "" | 3;
    34843484        sout | "x (" | 1 | "x [" | 2 | "x {" | 3 | "x =" | 4 | "x $" | 5 | "x £" | 6 | "x ¥"
    3485                 | 7 | "x ¡" | 8 | "x ¿" | 9 | "x «" | 10 | endl;
     3485                | 7 | "x ¡" | 8 | "x ¿" | 9 | "x «" | 10;
    34863486        sout | 1 | ", x" | 2 | ". x" | 3 | "; x" | 4 | "! x" | 5 | "? x" | 6 | "% x"
    3487                 | 7 | "¢ x" | 8 | "» x" | 9 | ") x" | 10 | "] x" | 11 | "} x" | endl;
    3488         sout | "x`" | 1 | "`x'" | 2 | "'x\"" | 3 | "\"x:" | 4 | ":x " | 5 | " x\t" | 6 | "\tx" | endl;
    3489         sout | "x ( " | 1 | " ) x" | 2 | " , x" | 3 | " :x: " | 4 | endl;
     3487                | 7 | "¢ x" | 8 | "» x" | 9 | ") x" | 10 | "] x" | 11 | "} x";
     3488        sout | "x`" | 1 | "`x'" | 2 | "'x\"" | 3 | "\"x:" | 4 | ":x " | 5 | " x\t" | 6 | "\tx";
     3489        sout | "x ( " | 1 | " ) x" | 2 | " , x" | 3 | " :x: " | 4;
    34903490
    34913491        sepSet( sout, ", $" );                                          // set separator from " " to ", $"
    3492         sout | 1 | 2 | 3 | " \"" | sep | "\"" | endl;
     3492        sout | 1 | 2 | 3 | " \"" | sep | "\"";
    34933493        sepSet( sout, " " );                                            // reset separator to " "
    3494         sout | 1 | 2 | 3 | " \"" | sepGet( sout ) | "\"" | endl;
     3494        sout | 1 | 2 | 3 | " \"" | sepGet( sout ) | "\"";
    34953495
    34963496        char store[sepSize];
    34973497        strcpy( store, sepGet( sout ) );
    34983498        sepSet( sout, "_" );
    3499         sout | 1 | 2 | 3 | endl;
     3499        sout | 1 | 2 | 3;
    35003500        sepSet( sout, store );
    3501         sout | 1 | 2 | 3 | endl;
     3501        sout | 1 | 2 | 3;
    35023502
    35033503        sepSetTuple( sout, " " );                                       // set tuple separator from ", " to " "
    3504         sout | t1 | t2 | " \"" | sepTuple | "\"" | endl;
     3504        sout | t1 | t2 | " \"" | sepTuple | "\"";
    35053505        sepSetTuple( sout, ", " );                                      // reset tuple separator to ", "
    3506         sout | t1 | t2 | " \"" | sepGetTuple( sout ) | "\"" | endl;
    3507 
    3508         sout | sepDisable | 1 | 2 | 3 | endl;           // globally turn off implicit separator
    3509         sout | sepEnable | 1 | 2 | 3 | endl;            // globally turn on implicit separator
    3510 
    3511         sout | 1 | sepOff | 2 | 3 | endl;                       // locally turn on implicit separator
    3512         sout | sepDisable | 1 | sepOn | 2 | 3 | endl; // globally turn off implicit separator
     3506        sout | t1 | t2 | " \"" | sepGetTuple( sout ) | "\"";
     3507
     3508        sout | sepDisable | 1 | 2 | 3;          // globally turn off implicit separator
     3509        sout | sepEnable | 1 | 2 | 3;           // globally turn on implicit separator
     3510
     3511        sout | 1 | sepOff | 2 | 3;                      // locally turn on implicit separator
     3512        sout | sepDisable | 1 | sepOn | 2 | 3; // globally turn off implicit separator
    35133513        sout | sepEnable;
    3514         sout | t1 | sepOff | t2 | endl;                         // locally turn on/off implicit separator
    3515 
    3516         sout | sepOn | 1 | 2 | 3 | sepOn | endl ;       // sepOn does nothing at start/end of line
    3517         sout | sep | 1 | 2 | 3 | sep | endl ;           // use sep to print separator at start/end of line
     3514        sout | t1 | sepOff | t2;                                // locally turn on/off implicit separator
     3515
     3516        sout | sepOn | 1 | 2 | 3 | sepOn ;      // sepOn does nothing at start/end of line
     3517        sout | sep | 1 | 2 | 3 | sep ;          // use sep to print separator at start/end of line
    35183518}
    35193519
     
    41804180        Fibonacci f1, f2;
    41814181        for ( int i = 1; i <= 10; i += 1 ) {
    4182                 sout | next( &f1 ) | ' ' | next( &f2 ) | endl;
     4182                sout | next( &f1 ) | ' ' | next( &f2 );
    41834183        } // for
    41844184}
     
    42464246                MyThread f[4];
    42474247        }
    4248         sout | global.value | endl;
     4248        sout | global.value;
    42494249}
    42504250\end{cfa}
     
    43244324void main( First * this ) {
    43254325        for ( int i = 0; i < 10; i += 1 ) {
    4326                 sout | "First : Suspend No." | i + 1 | endl;
     4326                sout | "First : Suspend No." | i + 1;
    43274327                yield();
    43284328        }
     
    43334333        wait( this->lock );
    43344334        for ( int i = 0; i < 10; i += 1 ) {
    4335                 sout | "Second : Suspend No." | i + 1 | endl;
     4335                sout | "Second : Suspend No." | i + 1;
    43364336                yield();
    43374337        }
     
    43404340int main( void ) {
    43414341        signal_once lock;
    4342         sout | "User main begin" | endl;
     4342        sout | "User main begin";
    43434343        {
    43444344                processor p;
     
    43484348                }
    43494349        }
    4350         sout | "User main end" | endl;
     4350        sout | "User main end";
    43514351}
    43524352\end{cfa}
     
    50455045void ?{}( Line * l ) {
    50465046        l->lnth = 0.0;
    5047         sout | "default" | endl;
     5047        sout | "default";
    50485048}
    50495049
     
    50525052void ?{}( Line * l, float lnth ) {
    50535053        l->lnth = lnth;
    5054         sout | "lnth" | l->lnth | endl;
     5054        sout | "lnth" | l->lnth;
    50555055
    50565056}
     
    50585058// destructor
    50595059void ^?() {
    5060         sout | "destroyed" | endl;
     5060        sout | "destroyed";
    50615061        l.lnth = 0.0;
    50625062}
     
    58045804In particular, output of ©char© variable now print a character rather than the decimal ASCII value of the character.
    58055805\begin{cfa}
    5806 sout | 'x' | " " | (int)'x' | endl;
     5806sout | 'x' | " " | (int)'x';
    58075807x 120
    58085808\end{cfa}
     
    70347034#include <gmp>§\indexc{gmp}§
    70357035int main( void ) {
    7036         sout | "Factorial Numbers" | endl;
     7036        sout | "Factorial Numbers";
    70377037        Int fact = 1;
    70387038
    7039         sout | 0 | fact | endl;
     7039        sout | 0 | fact;
    70407040        for ( unsigned int i = 1; i <= 40; i += 1 ) {
    70417041                fact *= i;
    7042                 sout | i | fact | endl;
     7042                sout | i | fact;
    70437043        }
    70447044}
Note: See TracChangeset for help on using the changeset viewer.