# Changeset e73d449 for doc/papers/concurrency

Ignore:
Timestamp:
Mar 22, 2019, 3:45:28 PM (5 years ago)
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
1097bb7, d4a60ac
Parents:
f8cd310
Message:

formatting

Location:
doc/papers/concurrency/examples
Files:
3 edited

Unmodified
Removed
• ## doc/papers/concurrency/examples/Fib.py

 rf8cd310 def Fibonacci(): def Fib(): fn = 0; fn1 = fn; yield fn  # suspend fn = 1; fn2 = fn1; fn1 = fn; yield fn f1 = Fibonacci() f2 = Fibonacci() f1 = Fib() f2 = Fib() for i in range( 10 ): print( next( f1 ), next( f2 ) )  # resume
• ## doc/papers/concurrency/examples/FibRefactor.py

 rf8cd310 def Fibonacci(): def Fib(): def Refactor(): nonlocal fn, fn1, fn2 nonlocal fn, fn1 fn = 0; fn1 = fn yield fn                                                # suspend def Refactor2(): nonlocal fn, fn1, fn2 fn = fn1 + fn2; fn2 = fn1; fn1 = fn; yield fn f1 = Fibonacci() f2 = Fibonacci() f1 = Fib() f2 = Fib() for i in range( 10 ): print( next( f1 ), next( f2 ) )         # resume
• ## doc/papers/concurrency/examples/Format.cc

 rf8cd310 // Local Variables: // // tab-width: 4 // // fill-column: 120 // // compile-command: "u++-work -O2 -nodebubg Format.cc" // // End: //
Note: See TracChangeset for help on using the changeset viewer.