Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/coroutine/fibonacci.cfa

    r5c46672 r427854b  
    3131}
    3232
     33int next( Fibonacci & fib ) with( fib ) {
     34        resume( fib );                                                                          // restart last suspend
     35        return fn;
     36}
     37
    3338int main() {
    3439        Fibonacci f1, f2;
    3540        for ( 10 ) {                                                                            // print N Fibonacci values
    36                 sout | resume( f1 ).fn | resume( f2 ).fn;
     41                sout | next( f1 ) | next( f2 );
    3742        } // for
    3843}
Note: See TracChangeset for help on using the changeset viewer.