Skip to content

Instantly share code, notes, and snippets.

@lyxal
Created December 13, 2021 06:32
Show Gist options
  • Save lyxal/f15d2d5ac387326647ec63c1abe4fd18 to your computer and use it in GitHub Desktop.
Save lyxal/f15d2d5ac387326647ec63c1abe4fd18 to your computer and use it in GitHub Desktop.
def VAR_f(arg_stack, self, arity=-1, ctx=None):
parameters = []
parameters += wrapify(arg_stack, 1, ctx)
stack = parameters[::]
ctx.context_values.append(parameters[::])
ctx.stacks.append(stack)
ctx.inputs.append([parameters[::], 0])
this = VAR_f
stack.append(sympy.nsimplify("1"))
rhs, lhs = pop(stack, 2, ctx); stack.append(add(lhs, rhs, ctx=ctx))
ctx.context_values.pop()
ctx.inputs.pop()
ctx.stacks.pop()
return stack
def VAR_g(arg_stack, self, arity=-1, ctx=None):
parameters = []
parameters += wrapify(arg_stack, 1, ctx)
stack = parameters[::]
ctx.context_values.append(parameters[::])
ctx.stacks.append(stack)
ctx.inputs.append([parameters[::], 0])
this = VAR_g
stack += VAR_f(stack, self=None, ctx=ctx)
ctx.context_values.pop()
ctx.inputs.pop()
ctx.stacks.pop()
return stack
stack += VAR_g(stack, self=None, ctx=ctx)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment