Changeset e99e43f for doc/user/user.tex
- Timestamp:
- Jan 10, 2019, 3:50:34 PM (7 years ago)
- 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:
- d97c3a4
- Parents:
- aeb8f70 (diff), 08222c7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- Aaron Moss <a3moss@…> (01/10/19 14:46:09)
- git-committer:
- Aaron Moss <a3moss@…> (01/10/19 15:50:34)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/user/user.tex
raeb8f70 re99e43f 11 11 %% Created On : Wed Apr 6 14:53:29 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Fri Aug 31 07:54:50201814 %% Update Count : 3 39613 %% Last Modified On : Tue Dec 11 23:19:26 2018 14 %% Update Count : 3400 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 178 178 int main( void ) { 179 179 int x = 0, y = 1, z = 2; 180 ®sout | x | y | z | endl;®§\indexc{sout}§180 ®sout | x | y | z;®§\indexc{sout}§ 181 181 } 182 182 \end{cfa} … … 513 513 Floating exponentiation\index{exponentiation!floating} is performed using \Index{logarithm}s\index{exponentiation!logarithm}, so the base cannot be negative. 514 514 \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;515 sout | 2 ®\® 8u | 4 ®\® 3u | -4 ®\® 3u | 4 ®\® -3 | -4 ®\® -3 | 4.0 ®\® 2.1 | (1.0f+2.0fi) ®\® (3.0f+2.0fi); 516 516 256 64 -64 0.015625 -0.015625 18.3791736799526 0.264715-1.1922i 517 517 \end{cfa} … … 547 547 548 548 549 %\subsection{\texorpdfstring{\protect\lstinline@for@ Statement}{for Statement}} 550 \subsection{\texorpdfstring{\LstKeywordStyle{for} Statement}{for Statement}} 549 \subsection{Loop Control} 551 550 552 551 The ©for©/©while©/©do-while© loop-control allows empty or simplified ranges. … … 557 556 the down-to range ©-~=©\index{-~=@©-~=©} means inclusive range [N,M]. 558 557 ©0© is the implicit start value; 559 ©1© is the implicit increment value for an up-to range and ©-1© for an implicit down-to range. 558 ©1© is the implicit increment value. 559 The up-to range uses ©+=© for increment; 560 the down-to range uses ©-=© for decrement. 560 561 The loop index is polymorphic in the type of the start value or comparison value when start is implicitly ©0©. 561 562 \begin{cquote} 562 563 \begin{tabular}{@{}ll|l@{}} 563 \multicolumn{2}{c|}{ forcontrol} & \multicolumn{1}{c}{output} \\564 \multicolumn{2}{c|}{loop control} & \multicolumn{1}{c}{output} \\ 564 565 \hline 565 566 \begin{cfa} … … 571 572 for ( ®10® ) { sout | "A"; } 572 573 for ( ®1 ~= 10 ~ 2® ) { sout | "B"; } 573 for ( ®10 -~= 1 ~ -2® ) { sout | "C"; }574 for ( ®10 -~= 1 ~ 2® ) { sout | "C"; } 574 575 for ( ®0.5 ~ 5.5® ) { sout | "D"; } 575 576 for ( ®5.5 -~ 0.5® ) { sout | "E"; } 576 577 for ( ®i; 10® ) { sout | i; } 577 578 for ( ®i; 1 ~= 10 ~ 2® ) { sout | i; } 578 for ( ®i; 10 -~= 1 ~ -2® ) { sout | i; }579 for ( ®i; 10 -~= 1 ~ 2® ) { sout | i; } 579 580 for ( ®i; 0.5 ~ 5.5® ) { sout | i; } 580 581 for ( ®i; 5.5 -~ 0.5® ) { sout | i; } 581 582 for ( ®ui; 2u ~= 10u ~ 2u® ) { sout | ui; } 582 for ( ®ui; 10u -~= 2u ~ -2u® ) { sout | ui; } 583 int start = 3, comp = 10, inc = 2; 583 for ( ®ui; 10u -~= 2u ~ 2u® ) { sout | ui; } 584 enum { N = 10 }; 585 for ( ®N® ) { sout | "N"; } 586 for ( ®i; N® ) { sout | i; } 587 for ( ®i; N -~ 0® ) { sout | i; } 588 const int start = 3, comp = 10, inc = 2; 584 589 for ( ®i; start ~ comp ~ inc + 1® ) { sout | i; } 585 590 \end{cfa} 586 591 & 587 592 \begin{cfa} 588 sout | endl; 589 sout | endl; 590 sout | endl; 591 sout | endl; 592 sout | endl; 593 sout | endl; 594 sout | endl; 595 sout | endl; 596 sout | 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 606 sout | endl; 593 sout | nl; 594 sout | nl; 595 sout | nl; 596 sout | "zero" | nl; 597 sout | nl; 598 sout | nl; 599 sout | nl; 600 sout | nl; 601 sout | nl; 602 sout | nl; 603 sout | nl; 604 sout | nl; 605 sout | nl; 606 sout | nl; 607 sout | nl; 608 sout | nl; 609 sout | nl | nl; 610 611 sout | nl; 612 sout | nl; 613 sout | nl | nl; 614 615 sout | nl; 607 616 \end{cfa} 608 617 & … … 611 620 empty 612 621 empty 613 622 zero 614 623 A 615 624 A A A A A A A A A A … … 625 634 2 4 6 8 10 626 635 10 8 6 4 2 636 637 N N N N N N N N N N 638 0 1 2 3 4 5 6 7 8 9 639 10 9 8 7 6 5 4 3 2 1 627 640 628 641 3 6 9 … … 2446 2459 int bar( int p ) { 2447 2460 ®i® += 1; §\C{// dependent on local variable}§ 2448 sout | ®i® | endl;2461 sout | ®i®; 2449 2462 } 2450 2463 return bar; §\C{// undefined because of local dependence}§ … … 2452 2465 int main() { 2453 2466 * [int]( int ) fp = foo(); §\C{// int (* fp)( int )}§ 2454 sout | fp( 3 ) | endl;2467 sout | fp( 3 ); 2455 2468 } 2456 2469 \end{cfa} … … 3218 3231 \begin{cfa} 3219 3232 int x = 1, y = 2, z = 3; 3220 sout | x ®|® y ®|® z | endl;3233 sout | x ®|® y ®|® z; 3221 3234 \end{cfa} 3222 3235 & … … 3239 3252 \begin{cfa} 3240 3253 [int, [ int, int ] ] t1 = [ 1, [ 2, 3 ] ], t2 = [ 4, [ 5, 6 ] ]; 3241 sout | t1 | t2 | endl;§\C{// print tuples}§3254 sout | t1 | t2; §\C{// print tuples}§ 3242 3255 \end{cfa} 3243 3256 \begin{cfa}[showspaces=true,aboveskip=0pt] … … 3251 3264 & 3252 3265 \begin{cfa} 3253 sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2) | endl;3266 sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2); 3254 3267 \end{cfa} 3255 3268 \\ … … 3277 3290 A separator does not appear at the start or end of a line. 3278 3291 \begin{cfa}[belowskip=0pt] 3279 sout | 1 | 2 | 3 | endl;3292 sout | 1 | 2 | 3; 3280 3293 \end{cfa} 3281 3294 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] … … 3286 3299 A separator does not appear before or after a character literal or variable. 3287 3300 \begin{cfa} 3288 sout | '1' | '2' | '3' | endl;3301 sout | '1' | '2' | '3'; 3289 3302 123 3290 3303 \end{cfa} … … 3293 3306 A separator does not appear before or after a null (empty) C string. 3294 3307 \begin{cfa} 3295 sout | 1 | "" | 2 | "" | 3 | endl;3308 sout | 1 | "" | 2 | "" | 3; 3296 3309 123 3297 3310 \end{cfa} … … 3303 3316 \begin{cfa}[mathescape=off] 3304 3317 sout | "x (" | 1 | "x [" | 2 | "x {" | 3 | "x =" | 4 | "x $" | 5 | "x £" | 6 | "x ¥" 3305 | 7 | "x ¡" | 8 | "x ¿" | 9 | "x «" | 10 | endl;3318 | 7 | "x ¡" | 8 | "x ¿" | 9 | "x «" | 10; 3306 3319 \end{cfa} 3307 3320 %$ … … 3317 3330 \begin{cfa}[belowskip=0pt] 3318 3331 sout | 1 | ", x" | 2 | ". x" | 3 | "; x" | 4 | "! x" | 5 | "? x" | 6 | "% x" 3319 | 7 | "¢ x" | 8 | "» x" | 9 | ") x" | 10 | "] x" | 11 | "} x" | endl;3332 | 7 | "¢ x" | 8 | "» x" | 9 | ") x" | 10 | "] x" | 11 | "} x"; 3320 3333 \end{cfa} 3321 3334 \begin{cfa}[basicstyle=\tt,showspaces=true,aboveskip=0pt,belowskip=0pt] … … 3327 3340 A 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@ 3328 3341 \begin{cfa}[belowskip=0pt] 3329 sout | "x`" | 1 | "`x'" | 2 | "'x\"" | 3 | "\"x:" | 4 | ":x " | 5 | " x\t" | 6 | "\tx" | endl;3342 sout | "x`" | 1 | "`x'" | 2 | "'x\"" | 3 | "\"x:" | 4 | ":x " | 5 | " x\t" | 6 | "\tx"; 3330 3343 \end{cfa} 3331 3344 \begin{cfa}[basicstyle=\tt,showspaces=true,showtabs=true,aboveskip=0pt,belowskip=0pt] … … 3336 3349 If a space is desired before or after one of the special string start/end characters, simply insert a space. 3337 3350 \begin{cfa}[belowskip=0pt] 3338 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;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; 3339 3352 \end{cfa} 3340 3353 \begin{cfa}[basicstyle=\tt,showspaces=true,showtabs=true,aboveskip=0pt,belowskip=0pt] … … 3353 3366 \begin{cfa}[mathescape=off,belowskip=0pt] 3354 3367 sepSet( sout, ", $" ); §\C{// set separator from " " to ", \$"}§ 3355 sout | 1 | 2 | 3 | " \"" | ®sep® | "\"" | endl;3368 sout | 1 | 2 | 3 | " \"" | ®sep® | "\""; 3356 3369 \end{cfa} 3357 3370 %$ … … 3362 3375 \begin{cfa}[belowskip=0pt] 3363 3376 sepSet( sout, " " ); §\C{// reset separator to " "}§ 3364 sout | 1 | 2 | 3 | " \"" | ®sepGet( sout )® | "\"" | endl;3377 sout | 1 | 2 | 3 | " \"" | ®sepGet( sout )® | "\""; 3365 3378 \end{cfa} 3366 3379 \begin{cfa}[showspaces=true,aboveskip=0pt] … … 3372 3385 strcpy( store, sepGet( sout ) ); §\C{// copy current separator}§ 3373 3386 sepSet( sout, "_" ); §\C{// change separator to underscore}§ 3374 sout | 1 | 2 | 3 | endl;3387 sout | 1 | 2 | 3; 3375 3388 \end{cfa} 3376 3389 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] … … 3379 3392 \begin{cfa}[belowskip=0pt] 3380 3393 sepSet( sout, store ); §\C{// change separator back to original}§ 3381 sout | 1 | 2 | 3 | endl;3394 sout | 1 | 2 | 3; 3382 3395 \end{cfa} 3383 3396 \begin{cfa}[showspaces=true,aboveskip=0pt] … … 3390 3403 \begin{cfa}[belowskip=0pt] 3391 3404 sepSetTuple( sout, " " ); §\C{// set tuple separator from ", " to " "}§ 3392 sout | t1 | t2 | " \"" | ®sepTuple® | "\"" | endl;3405 sout | t1 | t2 | " \"" | ®sepTuple® | "\""; 3393 3406 \end{cfa} 3394 3407 \begin{cfa}[showspaces=true,aboveskip=0pt] … … 3397 3410 \begin{cfa}[belowskip=0pt] 3398 3411 sepSetTuple( sout, ", " ); §\C{// reset tuple separator to ", "}§ 3399 sout | t1 | t2 | " \"" | ®sepGetTuple( sout )® | "\"" | endl;3412 sout | t1 | t2 | " \"" | ®sepGetTuple( sout )® | "\""; 3400 3413 \end{cfa} 3401 3414 \begin{cfa}[showspaces=true,aboveskip=0pt] … … 3407 3420 Manipulators \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. 3408 3421 \begin{cfa}[belowskip=0pt] 3409 sout | sepDisable | 1 | 2 | 3 | endl;§\C{// globally turn off implicit separator}§3422 sout | sepDisable | 1 | 2 | 3; §\C{// globally turn off implicit separator}§ 3410 3423 \end{cfa} 3411 3424 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] … … 3413 3426 \end{cfa} 3414 3427 \begin{cfa}[belowskip=0pt] 3415 sout | sepEnable | 1 | 2 | 3 | endl; §\C{// globally turn on implicit separator}§3428 sout | sepEnable | 1 | 2 | 3; §\C{// globally turn on implicit separator}§ 3416 3429 \end{cfa} 3417 3430 \begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt] … … 3422 3435 Manipulators \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. 3423 3436 \begin{cfa}[belowskip=0pt] 3424 sout | 1 | sepOff | 2 | 3 | endl; §\C{// locally turn off implicit separator}§3437 sout | 1 | sepOff | 2 | 3; §\C{// locally turn off implicit separator}§ 3425 3438 \end{cfa} 3426 3439 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] … … 3428 3441 \end{cfa} 3429 3442 \begin{cfa}[belowskip=0pt] 3430 sout | sepDisable | 1 | sepOn | 2 | 3 | endl; §\C{// locally turn on implicit separator}§3443 sout | sepDisable | 1 | sepOn | 2 | 3; §\C{// locally turn on implicit separator}§ 3431 3444 \end{cfa} 3432 3445 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] … … 3435 3448 The tuple separator also responses to being turned on and off. 3436 3449 \begin{cfa}[belowskip=0pt] 3437 sout | t1 | sepOff | t2 | endl; §\C{// locally turn on/off implicit separator}§3450 sout | t1 | sepOff | t2; §\C{// locally turn on/off implicit separator}§ 3438 3451 \end{cfa} 3439 3452 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] … … 3443 3456 use ©sep© to accomplish this functionality. 3444 3457 \begin{cfa}[belowskip=0pt] 3445 sout | sepOn | 1 | 2 | 3 | sepOn | endl; §\C{// sepOn does nothing at start/end of line}§3458 sout | sepOn | 1 | 2 | 3 | sepOn; §\C{// sepOn does nothing at start/end of line}§ 3446 3459 \end{cfa} 3447 3460 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] … … 3449 3462 \end{cfa} 3450 3463 \begin{cfa}[belowskip=0pt] 3451 sout | sep | 1 | 2 | 3 | sep | endl; §\C{// use sep to print separator at start/end of line}§3464 sout | sep | 1 | 2 | 3 | sep ; §\C{// use sep to print separator at start/end of line}§ 3452 3465 \end{cfa} 3453 3466 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] … … 3462 3475 int main( void ) { 3463 3476 int x = 1, y = 2, z = 3; 3464 sout | x | y | z | endl;3477 sout | x | y | z; 3465 3478 [int, [ int, int ] ] t1 = [ 1, [ 2, 3 ] ], t2 = [ 4, [ 5, 6 ] ]; 3466 sout | t1 | t2 | endl; // print tuples3467 sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2) | endl;3468 sout | 1 | 2 | 3 | endl;3469 sout | '1' | '2' | '3' | endl;3470 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; 3471 3484 sout | "x (" | 1 | "x [" | 2 | "x {" | 3 | "x =" | 4 | "x $" | 5 | "x £" | 6 | "x ¥" 3472 | 7 | "x ¡" | 8 | "x ¿" | 9 | "x «" | 10 | endl;3485 | 7 | "x ¡" | 8 | "x ¿" | 9 | "x «" | 10; 3473 3486 sout | 1 | ", x" | 2 | ". x" | 3 | "; x" | 4 | "! x" | 5 | "? x" | 6 | "% x" 3474 | 7 | "¢ x" | 8 | "» x" | 9 | ") x" | 10 | "] x" | 11 | "} x" | endl;3475 sout | "x`" | 1 | "`x'" | 2 | "'x\"" | 3 | "\"x:" | 4 | ":x " | 5 | " x\t" | 6 | "\tx" | endl;3476 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; 3477 3490 3478 3491 sepSet( sout, ", $" ); // set separator from " " to ", $" 3479 sout | 1 | 2 | 3 | " \"" | sep | "\"" | endl;3492 sout | 1 | 2 | 3 | " \"" | sep | "\""; 3480 3493 sepSet( sout, " " ); // reset separator to " " 3481 sout | 1 | 2 | 3 | " \"" | sepGet( sout ) | "\"" | endl;3494 sout | 1 | 2 | 3 | " \"" | sepGet( sout ) | "\""; 3482 3495 3483 3496 char store[sepSize]; 3484 3497 strcpy( store, sepGet( sout ) ); 3485 3498 sepSet( sout, "_" ); 3486 sout | 1 | 2 | 3 | endl;3499 sout | 1 | 2 | 3; 3487 3500 sepSet( sout, store ); 3488 sout | 1 | 2 | 3 | endl;3501 sout | 1 | 2 | 3; 3489 3502 3490 3503 sepSetTuple( sout, " " ); // set tuple separator from ", " to " " 3491 sout | t1 | t2 | " \"" | sepTuple | "\"" | endl;3504 sout | t1 | t2 | " \"" | sepTuple | "\""; 3492 3505 sepSetTuple( sout, ", " ); // reset tuple separator to ", " 3493 sout | t1 | t2 | " \"" | sepGetTuple( sout ) | "\"" | endl;3494 3495 sout | sepDisable | 1 | 2 | 3 | endl; // globally turn off implicit separator3496 sout | sepEnable | 1 | 2 | 3 | endl; // globally turn on implicit separator3497 3498 sout | 1 | sepOff | 2 | 3 | endl; // locally turn on implicit separator3499 sout | sepDisable | 1 | sepOn | 2 | 3 | endl; // globally turn off implicit separator3506 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 3500 3513 sout | sepEnable; 3501 sout | t1 | sepOff | t2 | endl; // locally turn on/off implicit separator3502 3503 sout | sepOn | 1 | 2 | 3 | sepOn | endl; // sepOn does nothing at start/end of line3504 sout | sep | 1 | 2 | 3 | sep | endl; // use sep to print separator at start/end of line3514 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 3505 3518 } 3506 3519 … … 4167 4180 Fibonacci f1, f2; 4168 4181 for ( int i = 1; i <= 10; i += 1 ) { 4169 sout | next( &f1 ) | ' ' | next( &f2 ) | endl;4182 sout | next( &f1 ) | ' ' | next( &f2 ); 4170 4183 } // for 4171 4184 } … … 4233 4246 MyThread f[4]; 4234 4247 } 4235 sout | global.value | endl;4248 sout | global.value; 4236 4249 } 4237 4250 \end{cfa} … … 4311 4324 void main( First * this ) { 4312 4325 for ( int i = 0; i < 10; i += 1 ) { 4313 sout | "First : Suspend No." | i + 1 | endl;4326 sout | "First : Suspend No." | i + 1; 4314 4327 yield(); 4315 4328 } … … 4320 4333 wait( this->lock ); 4321 4334 for ( int i = 0; i < 10; i += 1 ) { 4322 sout | "Second : Suspend No." | i + 1 | endl;4335 sout | "Second : Suspend No." | i + 1; 4323 4336 yield(); 4324 4337 } … … 4327 4340 int main( void ) { 4328 4341 signal_once lock; 4329 sout | "User main begin" | endl;4342 sout | "User main begin"; 4330 4343 { 4331 4344 processor p; … … 4335 4348 } 4336 4349 } 4337 sout | "User main end" | endl;4350 sout | "User main end"; 4338 4351 } 4339 4352 \end{cfa} … … 5032 5045 void ?{}( Line * l ) { 5033 5046 l->lnth = 0.0; 5034 sout | "default" | endl;5047 sout | "default"; 5035 5048 } 5036 5049 … … 5039 5052 void ?{}( Line * l, float lnth ) { 5040 5053 l->lnth = lnth; 5041 sout | "lnth" | l->lnth | endl;5054 sout | "lnth" | l->lnth; 5042 5055 5043 5056 } … … 5045 5058 // destructor 5046 5059 void ^?() { 5047 sout | "destroyed" | endl;5060 sout | "destroyed"; 5048 5061 l.lnth = 0.0; 5049 5062 } … … 5791 5804 In particular, output of ©char© variable now print a character rather than the decimal ASCII value of the character. 5792 5805 \begin{cfa} 5793 sout | 'x' | " " | (int)'x' | endl;5806 sout | 'x' | " " | (int)'x'; 5794 5807 x 120 5795 5808 \end{cfa} … … 7021 7034 #include <gmp>§\indexc{gmp}§ 7022 7035 int main( void ) { 7023 sout | "Factorial Numbers" | endl;7036 sout | "Factorial Numbers"; 7024 7037 Int fact = 1; 7025 7038 7026 sout | 0 | fact | endl;7039 sout | 0 | fact; 7027 7040 for ( unsigned int i = 1; i <= 40; i += 1 ) { 7028 7041 fact *= i; 7029 sout | i | fact | endl;7042 sout | i | fact; 7030 7043 } 7031 7044 }
Note:
See TracChangeset
for help on using the changeset viewer.