示例#1
0
def redefining_var_as_list(a):
  # Initialize the tape
  _stack = tangent.Stack()
  x = a
  tangent.push(_stack, x, 'abc')
  x = [a]
  x = tangent.pop(_stack, 'abc')
  return a
示例#2
0
def stack_pushing(a):
  stack = tangent.Stack()
  y = a * a
  tangent.push(stack, a, 'abc')
  aa = tangent.pop(stack, 'abc')
  z = y * aa
  z = z * aa
  return z
示例#3
0
def useless_stack_ops(a):
  _stack = tangent.Stack()
  b = a * a
  tangent.push(_stack, b, 'abc')
  b = tangent.pop(_stack, 'abc')
  return a
示例#4
0
def apush(stack, val, op_id):
    d[val] = tangent.pop(stack, d[op_id])
示例#5
0
def tpop(x, stack, op_id):
    d[x] = tangent.pop(d[stack], d[op_id])