ADT
        arm-eh
        ast-experimental
        enum
        forall-pointer-decay
        jacob/cs343-translation
        new-ast-unique-expr
        pthread-emulation
        qualifiedEnum
      
      
        
          | 
            Last change
 on this file since 474d610 was             2aab69b, checked in by Peter A. Buhr <pabuhr@…>, 6 years ago           | 
        
        
          | 
             
files added to concurrency paper 
 
           | 
        
        
          
            
              - 
Property                 mode
 set to                 
100644
               
             
           | 
        
        
          | 
            File size:
            341 bytes
           | 
        
      
      
| Rev | Line |   | 
|---|
| [2aab69b] | 1 | function * fib() {
 | 
|---|
 | 2 |         var fn1 = 1, fn = 0;
 | 
|---|
 | 3 |         while ( true ) {
 | 
|---|
 | 4 |                 var ret = fn; fn = fn1; fn1 = fn + ret;
 | 
|---|
 | 5 |                 yield ret;
 | 
|---|
 | 6 |         } // while
 | 
|---|
 | 7 | }
 | 
|---|
 | 8 | 
 | 
|---|
 | 9 | f1 = fib();
 | 
|---|
 | 10 | f2 = fib();
 | 
|---|
 | 11 | for ( var i = fib.length; i < 10; i += 1 ) {
 | 
|---|
 | 12 |         console.log( f1.next().value, f2.next().value );
 | 
|---|
 | 13 | }
 | 
|---|
 | 14 | 
 | 
|---|
 | 15 | // Local Variables: //
 | 
|---|
 | 16 | // tab-width: 4 //
 | 
|---|
 | 17 | // compile-command: "node Fib.js" //
 | 
|---|
 | 18 | // End: //
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.