예제 #1
0
 def example():
     v1 = f(one(), 2*one())
     s2 = rstack.resume_state_create(None, "rp2", 2*one())
     c = C()
     c.x = 4*one()
     s1 = rstack.resume_state_create(s2, "rp1", c)
     return v1*100 + rstack.resume_state_invoke(int, s1)
예제 #2
0
 def example():
     v1 = f(one(), 2 * one())
     s2 = rstack.resume_state_create(None, "rp2", 2 * one())
     c = C()
     c.x = 4 * one()
     s1 = rstack.resume_state_create(s2, "rp1", c)
     return v1 * 100 + rstack.resume_state_invoke(int, s1)
예제 #3
0
 def example():
     v1 = g(one())
     s = rstack.resume_state_create(None, "rp0", one() - 1)
     try:
         v2 = rstack.resume_state_invoke(int, s)
     except KeyError:
         v2 = 42
     return v1 * 100 + v2
예제 #4
0
 def example():
     v1 = g(one())
     s = rstack.resume_state_create(None, "rp0", one()-1)
     try:
         v2 = rstack.resume_state_invoke(int, s)
     except KeyError:
         v2 = 42
     return v1*100 + v2
예제 #5
0
 def example():
     out = []
     x = h(out)
     l  = len(out)
     chain = rstack.resume_state_create(None, 'h', out)
     chain = rstack.resume_state_create(chain, 'g')
     x += rstack.resume_state_invoke(int, chain)
     l += len(out)
     return l*100+x
예제 #6
0
 def example():
     out = []
     x = h(out)
     l = len(out)
     chain = rstack.resume_state_create(None, 'h', out)
     chain = rstack.resume_state_create(chain, 'g')
     x += rstack.resume_state_invoke(int, chain)
     l += len(out)
     return l * 100 + x
예제 #7
0
 def example():
     v1 = f(one(), one() + one())
     state = rstack.resume_state_create(None, "rp0", one(),
                                        one() + one() + one())
     v2 = rstack.resume_state_invoke(int, state)
     return v1 * 10 + v2
예제 #8
0
 def example():
     v1 = f(one() + one())
     s1 = rstack.resume_state_create(None, "rp1")
     s0 = rstack.resume_state_create(s1, "rp0", 0)
     v2 = rstack.resume_state_invoke(int, s0, raising=KeyError())
     return v1 * 100 + v2
예제 #9
0
 def example():
     v1 = f(one() + one())
     s1 = rstack.resume_state_create(None, "rp1")
     s0 = rstack.resume_state_create(s1, "rp0", one() - 1)
     v2 = rstack.resume_state_invoke(int, s0)
     return v1 * 100 + v2
예제 #10
0
 def example():
     v1 = g(one()).x
     c = C()
     c.x = 4 * one()
     s1 = rstack.resume_state_create(None, "rp1", c)
     return v1 * 100 + rstack.resume_state_invoke(C, s1).x
예제 #11
0
 def example():
     v1 = f(one(),one()+one())
     s = rstack.resume_state_create(None, "rp1", 5*one())
     v2 = rstack.resume_state_invoke(int, s, returning=C(one()*3))
     return v1*100 + v2
예제 #12
0
 def example():
     v1 = f(one(),one()+one())
     state = rstack.resume_state_create(None, "rp0", one(), one()+one()+one())
     v2 = rstack.resume_state_invoke(int, state)
     return v1*10 + v2
예제 #13
0
 def example():
     v1 = f(one()+one())
     s1 = rstack.resume_state_create(None, "rp1")
     s0 = rstack.resume_state_create(s1, "rp0", 0)
     v2 = rstack.resume_state_invoke(int, s0, raising=KeyError())
     return v1*100 + v2
예제 #14
0
 def example():
     v1 = f(one()+one())
     s1 = rstack.resume_state_create(None, "rp1")
     s0 = rstack.resume_state_create(s1, "rp0", one()-1)
     v2 = rstack.resume_state_invoke(int, s0)
     return v1*100 + v2
예제 #15
0
 def example():
     v1 = g(one()).x
     c = C()
     c.x = 4*one()
     s1 = rstack.resume_state_create(None, "rp1", c)
     return v1*100 + rstack.resume_state_invoke(C, s1).x
예제 #16
0
 def example():
     v1 = f(one(), 2 * one(), 3 * one())
     s2 = rstack.resume_state_create(None, "rp2", 2 * one())
     s1 = rstack.resume_state_create(s2, "rp1", 4 * one(), 5 * one())
     return 100 * v1 + rstack.resume_state_invoke(int, s1)
예제 #17
0
 def example():
     v1 = f(one(), one() + one())
     s = rstack.resume_state_create(None, "rp1", 5 * one())
     v2 = rstack.resume_state_invoke(int, s, returning=C(one() * 3))
     return v1 * 100 + v2
예제 #18
0
 def example():
     v1 = f(one(), 2*one(), 3*one())
     s2 = rstack.resume_state_create(None, "rp2", 2*one())
     s1 = rstack.resume_state_create(s2, "rp1", 4*one(), 5*one())
     return 100*v1 + rstack.resume_state_invoke(int, s1)