Changeset d4a60ac for doc/papers/concurrency/examples/Fib.py
- Timestamp:
- Mar 25, 2019, 10:07:13 AM (4 years ago)
- Branches:
- arm-eh, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 5b993e0
- Parents:
- 7a8f5246 (diff), e73d449 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/papers/concurrency/examples/Fib.py
r7a8f5246 rd4a60ac 1 def Fib onacci():1 def Fib(): 2 2 fn = 0; fn1 = fn; yield fn # suspend 3 3 fn = 1; fn2 = fn1; fn1 = fn; yield fn … … 7 7 8 8 9 f1 = Fib onacci()10 f2 = Fib onacci()9 f1 = Fib() 10 f2 = Fib() 11 11 for i in range( 10 ): 12 12 print( next( f1 ), next( f2 ) ) # resume
Note: See TracChangeset
for help on using the changeset viewer.