Ignore:
Timestamp:
Jun 14, 2021, 2:48:44 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
733fd3d
Parents:
d363634
Message:

coroutine fibonacci now uses return from resume

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/coroutine/fibonacci.cfa

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