Changes in tests/coroutine/pingpong.cfa [363b48f:1427e90]
- File:
-
- 1 edited
-
tests/coroutine/pingpong.cfa (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/coroutine/pingpong.cfa
r363b48f r1427e90 10 10 // Created On : Wed Sep 20 11:55:23 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Mar 26 17:54:14 201913 // Update Count : 3512 // Last Modified On : Tue Dec 11 21:58:06 2018 13 // Update Count : 29 14 14 // 15 15 … … 20 20 const char * name; 21 21 /* const */ unsigned int N; 22 PingPong ∂22 PingPong * part; 23 23 }; 24 24 25 25 void ?{}( PingPong & this, const char * name, unsigned int N, PingPong & part ) { 26 this.[name, N] = [name, N]; &this.part = ∂ 26 (this.__cor){name}; 27 this.name = name; 28 this.N = N; 29 this.part = ∂ 27 30 } 28 31 void ?{}( PingPong & this, const char * name, unsigned int N ) { 29 this{ name, N, * 0p }; // call first constructor32 this{ name, N, *(PingPong *)0 }; 30 33 } 31 34 void cycle( PingPong & pingpong ) { … … 33 36 } 34 37 void partner( PingPong & this, PingPong & part ) { 35 &this.part = ∂38 this.part = ∂ 36 39 resume( this ); 37 40 } 38 void main( PingPong & pingpong ) with(pingpong) {// ping's starter ::main, pong's starter ping39 for ( N ) {// N ping-pongs40 sout | name;41 cycle( part );41 void main( PingPong & pingpong ) { // ping's starter ::main, pong's starter ping 42 for ( pingpong.N ) { // N ping-pongs 43 sout | pingpong.name; 44 cycle( *pingpong.part ); 42 45 } // for 43 46 } … … 50 53 // Local Variables: // 51 54 // tab-width: 4 // 52 // compile-command: "cfa pingpong.c fa" //55 // compile-command: "cfa pingpong.c" // 53 56 // End: //
Note:
See TracChangeset
for help on using the changeset viewer.